dgs.models.alpha.combined.SequentialCombinedAlpha

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

An alpha module sequentially combining multiple other BaseAlphaModule s. First load the data from the State using name. Then insert the resulting Tensor into the forward call of the respective next model.

Params

paths (list[str, NodePath]):

A list containing either NodePath s pointing to the configuration of a BaseAlphaModule or the name of a function from torch.nn (e.g. ‘Flatten’, ‘ReLU’, …). All submodules do not need to have the “name” property, because all other layers will use the result returned by the previous layer.

name (str):

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

Optional Params

__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)

Forward call for sequential model calls the next layer with the output of the previous layer.

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