trainable module

Trainable layers

class ArbitraryShapeRectangularDNN(*, d_in, out_shape, d_hidden, n_hidden, input_activation=None, hidden_activation=<class 'torch.nn.modules.activation.ReLU'>, output_activation=None, use_batch_norm=False)[source]

Bases: torch.nn.modules.module.Module

Rectangular DNN with the output layer reshaped to a given shape

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

forward(x)[source]
training: bool[source]
class OverallAffineLayer(alpha=10.0, delta=0.0)[source]

Bases: torch.nn.modules.module.Module

Learnable overall affine transformation f(x) = alpha x + delta

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

forward(input)[source]

Output of the OverallAffineLayer

training: bool[source]
create_rectangular_dnn(*, d_in, d_out, d_hidden, n_hidden, input_activation=None, hidden_activation=<class 'torch.nn.modules.activation.ReLU'>, output_activation=None, use_batch_norm=False)[source]