dgs.models.alpha.fully_connected.FullyConnectedAlpha

class dgs.models.alpha.fully_connected.FullyConnectedAlpha(*args: Any, **kwargs: Any)[source]

An alpha module consisting of L - 1 fully connected layers. Each layer can have a custom bias and activation function.

Params

name (str):

The name of the attribute or getter function used to retrieve the input data from the state.

hidden_layers (list[int]):

The sizes of each of the hidden layers, including the size of the data. Has length L.

bias (Union[bool, list[bool]):

Whether each of the respective layers should have values for the bias. Has length L - 1.

Optional Params

act_func (list[Union[str, None, nn.Module]]):

A list containing the activation functions placed after each of the layers. Has length L - 1. Default DEF_VAL.alpha.act_func.

__init__(config: dict[str, any], path: list[str])[source]

Methods

configure_torch_module(module[, train])

Set compute mode and send model to the device or multiple parallel devices if applicable.

forward(s)

get_data(s)

Given a state, return the data which is input into the model.

load_weights()

Load the weights of the model from the given file path.

sub_forward(data)

Function to call when module is called from within a combined alpha module.

terminate()

Terminate this module and all of its submodules.

validate_params(validations[, attrib_name])

Given per key validations, validate this module's parameters.

Attributes

device

Get the device of this module.

is_training

Get whether this module is set to training-mode.

module_name

Get the name of the module.

module_type

name

Get the name of the module.

name_safe

Get the escaped name of the module usable in filepaths by replacing spaces and underscores.

precision

Get the (floating point) precision used in multiple parts of this module.

model