unilab.algos.torch.common.networks¶
Neural network architectures for RL algorithms.
Classes
Twin distributional Q-networks for off-policy RL (SAC/TD3). |
|
Single distributional Q-network (C51 variant). |
- class unilab.algos.torch.common.networks.DistributionalQNetwork[source]¶
Bases:
ModuleSingle distributional Q-network (C51 variant).
Architecture: Linear→ReLU → Linear→ReLU → Linear→ReLU → Linear Outputs num_atoms logits over the value distribution.
- Parameters:
- __init__(obs_dim, n_act, num_atoms, v_min, v_max, hidden_dim, device=None)[source]¶
Initialize internal Module state, shared by both nn.Module and ScriptModule.
- forward(obs, actions)[source]¶
Define the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- class unilab.algos.torch.common.networks.Critic[source]¶
Bases:
ModuleTwin distributional Q-networks for off-policy RL (SAC/TD3).
- Parameters:
- q_support: torch.Tensor¶
- __init__(obs_dim, n_act, num_atoms, v_min, v_max, hidden_dim, device=None)[source]¶
Initialize internal Module state, shared by both nn.Module and ScriptModule.
- forward(obs, actions)[source]¶
Define the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.