GaussianActor Class
This class implements a GBT-based Gaussian Actor for reinforcement learning. The GaussianActor outputs mu and sigma of a Gaussain Distribution. Usage examples: GBT-based SAC/TD3/DDPG implementations.
- class gbrl.ac_gbrl.GaussianActor(tree_struct: Dict, output_dim: int, mu_optimizer: Dict, std_optimizer: Dict = None, log_std_init: float = -2, gbrl_params: Dict = {}, bias: ndarray = None, verbose: int = 0, device: str = 'cpu')[source]
Bases:
GBRL
- get_num_trees() int [source]
Returns the number of trees in the ensemble
- Returns:
number of trees
- Return type:
int
- step(observations: ndarray | Tensor, mu_grad_clip: float = None, log_std_grad_clip: float = None, mu_grad: ndarray | Tensor | None = None, log_std_grad: ndarray | Tensor | None = None) None [source]
Performs a single boosting iteration.
- Parameters:
observations (Union[np.ndarray, th.Tensor])
mu_grad_clip (float, optional)
log_std_grad_clip (float, optional)
mu_grad (Optional[Union[np.ndarray, th.Tensor]], optional) – manually calculated gradients. Defaults to None.
log_std_grad (Optional[Union[np.ndarray, th.Tensor]], optional) – manually calculated gradients. Defaults to None.