pqagent.mlp module
- class pqagent.mlp.MLP(in_features: int, out_features: int, fc_layers: list | str, activation_func: str, layer_normalization: bool = False, dropout: float = 0)[source]
Bases:
Module- forward(x: Tensor) Tensor[source]
Defines the computation performed at every call.
- Args:
x (torch.Tensor): Input tensor.
- Returns:
torch.Tensor: Output tensor.
- classmethod from_dict(param_space: dict, sweep_config: dict, in_features: int, out_features: int)[source]
- static train_fn(param_space: dict, sweep_config: dict, data: TrainingDataDict)[source]
- class pqagent.mlp.TrainingDataDict(X_train: torch.Tensor, y_train: torch.Tensor, X_val: torch.Tensor, y_val: torch.Tensor)[source]
Bases:
object- X_train: Tensor
- X_val: Tensor
- y_train: Tensor
- y_val: Tensor
- pqagent.mlp.base_training_strategy(net: ~torch.nn.modules.module.Module, data: ~pqagent.mlp.TrainingDataDict, param_space: dict, sweep_config: dict, start_epoch: int = 1, epochs: int = None, optimizer=None) -> (<class 'torch.nn.modules.module.Module'>, <module 'torch.optim' from '/usr/local/lib/python3.11/site-packages/torch/optim/__init__.py'>, <built-in function any>)[source]