Skip to content

SpectralNormDNN

SpectralNormDNN(sizes, dim_x=None, activation=nn.ELU(), full=False, generator=None)

Bases: Module

Fully-connected network with spectral normalization on hidden layers.

Parameters:

  • sizes (list of int) –

    Layer sizes including input and output dimensions.

  • dim_x –

    The dimension of the x variables to apply spectral norm. These are always the first dim_x dimensions of the data. The last dimensions are assumed to be 'time-like'.

  • activation (Module, default: torch.nn.ELU() ) –

    Hidden activation module.

  • full (bool, default: False ) –

    If True, also apply spectral normalization to the final layer.

  • generator (Generator or None, default: None ) –

    Optional RNG for reproducible weight initialization.