unilab.algos.torch.flash_sac.network

FlashSAC actor, critic, and temperature modules.

Classes

class unilab.algos.torch.flash_sac.network.FlashSACActor[source]

Bases: Module

Parameters:
zeta_cdf: torch.Tensor
__init__(num_blocks, input_dim, hidden_dim, action_dim, noise_zeta_mu=2.0, noise_zeta_max=16, device='cpu')[source]

Initialize internal Module state, shared by both nn.Module and ScriptModule.

Parameters:
normalize_parameters()[source]
Return type:

None

get_mean_and_std(observations, training)[source]
Parameters:
Return type:

tuple[Tensor, Tensor]

forward(observations, training)[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 Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

Parameters:
Return type:

tuple[Tensor, dict[str, Tensor]]

as_export_module()[source]

Return a single-input/single-output wrapper suitable for torch.onnx.export.

Return type:

Module

explore(obs, dones=None, deterministic=False)[source]
Parameters:
Return type:

Tensor

class unilab.algos.torch.flash_sac.network.FlashSACDoubleCritic[source]

Bases: Module

Parameters:
__init__(num_blocks, input_dim, hidden_dim, num_bins, min_v, max_v, num_qs=2, device='cpu')[source]

Initialize internal Module state, shared by both nn.Module and ScriptModule.

Parameters:
normalize_parameters()[source]
Return type:

None

forward(observations, actions, training)[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 Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

Parameters:
Return type:

tuple[Tensor, dict[str, Tensor]]

class unilab.algos.torch.flash_sac.network.FlashSACTemperature[source]

Bases: Module

Parameters:

initial_value (float)

__init__(initial_value=0.01)[source]

Initialize internal Module state, shared by both nn.Module and ScriptModule.

Parameters:

initial_value (float)

forward()[source]

Define the computation performed at every call.

Should be overridden by all subclasses. :rtype: Tensor

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.