Skip to content

Commit

Permalink
Update annotation and doctring
Browse files Browse the repository at this point in the history
  • Loading branch information
Toni-SM committed Aug 13, 2024
1 parent 4d55d04 commit afadb50
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
12 changes: 6 additions & 6 deletions skrl/utils/model_instantiators/jax/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def gaussian_model(observation_space: Optional[Union[int, Tuple[int], gym.Space,
output_shape: Shape = Shape.ACTIONS,
output_activation: Optional[str] = "tanh",
output_scale: float = 1.0,
return_source: bool = False) -> Model:
return_source: bool = False) -> Union[Model, str]:
"""Instantiate a Gaussian model
:param observation_space: Observation/state space or shape (default: None).
Expand Down Expand Up @@ -191,7 +191,7 @@ def gaussian_model(observation_space: Optional[Union[int, Tuple[int], gym.Space,
instantiate the model rather than the model instance (default: False).
:type return_source: bool, optional
:return: Gaussian model instance
:return: Gaussian model instance or definition source
:rtype: Model
"""
# network
Expand Down Expand Up @@ -242,7 +242,7 @@ def deterministic_model(observation_space: Optional[Union[int, Tuple[int], gym.S
output_shape: Shape = Shape.ACTIONS,
output_activation: Optional[str] = "tanh",
output_scale: float = 1.0,
return_source: bool = False) -> Model:
return_source: bool = False) -> Union[Model, str]:
"""Instantiate a deterministic model
:param observation_space: Observation/state space or shape (default: None).
Expand Down Expand Up @@ -273,7 +273,7 @@ def deterministic_model(observation_space: Optional[Union[int, Tuple[int], gym.S
instantiate the model rather than the model instance (default: False).
:type return_source: bool, optional
:return: Deterministic model instance
:return: Deterministic model instance or definition source
:rtype: Model
"""
# network
Expand Down Expand Up @@ -318,7 +318,7 @@ def categorical_model(observation_space: Optional[Union[int, Tuple[int], gym.Spa
hidden_activation: list = ["relu", "relu"],
output_shape: Shape = Shape.ACTIONS,
output_activation: Optional[str] = None,
return_source: bool = False) -> Model:
return_source: bool = False) -> Union[Model, str]:
"""Instantiate a categorical model
:param observation_space: Observation/state space or shape (default: None).
Expand Down Expand Up @@ -349,7 +349,7 @@ def categorical_model(observation_space: Optional[Union[int, Tuple[int], gym.Spa
instantiate the model rather than the model instance (default: False).
:type return_source: bool, optional
:return: Categorical model instance
:return: Categorical model instance or definition source
:rtype: Model
"""
# network
Expand Down
20 changes: 10 additions & 10 deletions skrl/utils/model_instantiators/torch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def gaussian_model(observation_space: Optional[Union[int, Tuple[int], gym.Space,
output_shape: Shape = Shape.ACTIONS,
output_activation: Optional[str] = "tanh",
output_scale: float = 1.0,
return_source: bool = False) -> Model:
return_source: bool = False) -> Union[Model, str]:
"""Instantiate a Gaussian model
:param observation_space: Observation/state space or shape (default: None).
Expand Down Expand Up @@ -200,7 +200,7 @@ def gaussian_model(observation_space: Optional[Union[int, Tuple[int], gym.Space,
instantiate the model rather than the model instance (default: False).
:type return_source: bool, optional
:return: Gaussian model instance
:return: Gaussian model instance or definition source
:rtype: Model
"""
# network
Expand Down Expand Up @@ -254,7 +254,7 @@ def multivariate_gaussian_model(observation_space: Optional[Union[int, Tuple[int
output_shape: Shape = Shape.ACTIONS,
output_activation: Optional[str] = "tanh",
output_scale: float = 1.0,
return_source: bool = False) -> Model:
return_source: bool = False) -> Union[Model, str]:
"""Instantiate a multivariate Gaussian model
:param observation_space: Observation/state space or shape (default: None).
Expand Down Expand Up @@ -293,7 +293,7 @@ def multivariate_gaussian_model(observation_space: Optional[Union[int, Tuple[int
instantiate the model rather than the model instance (default: False).
:type return_source: bool, optional
:return: Multivariate Gaussian model instance
:return: Multivariate Gaussian model instance or definition source
:rtype: Model
"""
# network
Expand Down Expand Up @@ -343,7 +343,7 @@ def deterministic_model(observation_space: Optional[Union[int, Tuple[int], gym.S
output_shape: Shape = Shape.ACTIONS,
output_activation: Optional[str] = "tanh",
output_scale: float = 1.0,
return_source: bool = False) -> Model:
return_source: bool = False) -> Union[Model, str]:
"""Instantiate a deterministic model
:param observation_space: Observation/state space or shape (default: None).
Expand Down Expand Up @@ -374,7 +374,7 @@ def deterministic_model(observation_space: Optional[Union[int, Tuple[int], gym.S
instantiate the model rather than the model instance (default: False).
:type return_source: bool, optional
:return: Deterministic model instance
:return: Deterministic model instance or definition source
:rtype: Model
"""
# network
Expand Down Expand Up @@ -418,7 +418,7 @@ def categorical_model(observation_space: Optional[Union[int, Tuple[int], gym.Spa
hidden_activation: list = ["relu", "relu"],
output_shape: Shape = Shape.ACTIONS,
output_activation: Optional[str] = None,
return_source: bool = False) -> Model:
return_source: bool = False) -> Union[Model, str]:
"""Instantiate a categorical model
:param observation_space: Observation/state space or shape (default: None).
Expand Down Expand Up @@ -449,7 +449,7 @@ def categorical_model(observation_space: Optional[Union[int, Tuple[int], gym.Spa
instantiate the model rather than the model instance (default: False).
:type return_source: bool, optional
:return: Categorical model instance
:return: Categorical model instance or definition source
:rtype: Model
"""
# network
Expand Down Expand Up @@ -489,7 +489,7 @@ def shared_model(observation_space: Optional[Union[int, Tuple[int], gym.Space, g
roles: Sequence[str] = [],
parameters: Sequence[Mapping[str, Any]] = [],
single_forward_pass: bool = True,
return_source: bool = False) -> Model:
return_source: bool = False) -> Union[Model, str]:
"""Instantiate a shared model
:param observation_space: Observation/state space or shape (default: None).
Expand All @@ -514,7 +514,7 @@ def shared_model(observation_space: Optional[Union[int, Tuple[int], gym.Space, g
instantiate the model rather than the model instance (default: False).
:type return_source: bool, optional
:return: Shared model instance
:return: Shared model instance or definition source
:rtype: Model
"""
# network
Expand Down

0 comments on commit afadb50

Please sign in to comment.