这是indexloc提供的服务,不要输入任何密码
Skip to content

Fix: Policy parameter action_scaling was not correctly transformed (high-level API) #1191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,13 @@
- `DataclassPPrintMixin` now supports outputting a string, not just printing the pretty repr. #1141

### Fixes
- `CriticFactoryReuseActor`: Enable the Critic flag `apply_preprocess_net_to_obs_only` for continuous critics,
fixing the case where we want to reuse an actor's preprocessing network for the critic (affects usages
of the experiment builder method `with_critic_factory_use_actor` with continuous environments) #1128
- `highlevel`:
- `CriticFactoryReuseActor`: Enable the Critic flag `apply_preprocess_net_to_obs_only` for continuous critics,
fixing the case where we want to reuse an actor's preprocessing network for the critic (affects usages
of the experiment builder method `with_critic_factory_use_actor` with continuous environments) #1128
- Policy parameter `action_scaling` value `"default"` was not correctly transformed to a Boolean value for
algorithms SAC, DDPG, TD3 and REDQ. The value `"default"` being truthy caused action scaling to be enabled
even for discrete action spaces. #1191
- `atari_network.DQN`:
- Fix constructor input validation #1128
- Fix `output_dim` not being set if `features_only`=True and `output_dim_added_layer` is not None #1128
Expand Down
3 changes: 1 addition & 2 deletions tianshou/highlevel/params/policy_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ class ParamsMixinActionScaling(GetParamTransformersProtocol):
"""

def _get_param_transformers(self) -> list[ParamTransformer]:
return []
return [ParamTransformerActionScaling("action_scaling")]


@dataclass
Expand Down Expand Up @@ -335,7 +335,6 @@ def _get_param_transformers(self) -> list[ParamTransformer]:
transformers = super()._get_param_transformers()
transformers.extend(ParamsMixinActionScaling._get_param_transformers(self))
transformers.extend(ParamsMixinLearningRateWithScheduler._get_param_transformers(self))
transformers.append(ParamTransformerActionScaling("action_scaling"))
transformers.append(ParamTransformerDistributionFunction("dist_fn"))
return transformers

Expand Down
Loading