hive.agents.qnets.mlp module
- class hive.agents.qnets.mlp.MLPNetwork(in_dim, hidden_units=256, noisy=False, std_init=0.5)[source]
Bases:
torch.nn.modules.module.ModuleBasic MLP neural network architecture.
Contains a series of
torch.nn.LinearorNoisyLinearlayers, each of which is followed by a ReLU.- Parameters
hidden_units (int | list[int]) – The number of neurons for each mlp layer.
noisy (bool) – Whether the MLP should use
NoisyLinearlayers or normaltorch.nn.Linearlayers.std_init (float) – The range for the initialization of the standard deviation of the weights in
NoisyLinear.
- forward(x)[source]
Defines 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.