vp_suite.model_blocks.enc

This module contains encoder/decoder/autoencoder model blocks.

class Autoencoder(img_shape, encoded_channels, device)

Bases: vp_suite.base.base_model_block.VPModelBlock

This class implements an autoencoder, consisting of a convolutional encoder and a decoder.

NAME: str = 'Autoencoder'

The clear-text name for this model block.

__init__(img_shape, encoded_channels, device)

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

build_models()
decode(x)
encode(x)
training: bool
class DCGANDecoder(out_size, img_channels=1, enc_channels=32)

Bases: vp_suite.base.base_model_block.VPModelBlock

The class implements a DCGAN decoder, as introduced in Radford et al. (arxiv.org/abs/1511.06434).

NAME: str = 'DCGAN Decoder'

The clear-text name for this model block.

PAPER_REFERENCE = 'arxiv.org/abs/1511.06434'

The publication where this model was introduced first.

__init__(out_size, img_channels=1, enc_channels=32)

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

forward(x)

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

training: bool
class DCGANEncoder(img_channels=1, enc_channels=32)

Bases: vp_suite.base.base_model_block.VPModelBlock

The class implements a DCGAN encoder, as introduced in Radford et al. (arxiv.org/abs/1511.06434).

NAME: str = 'DCGAN Encoder'

The clear-text name for this model block.

PAPER_REFERENCE = 'arxiv.org/abs/1511.06434'

The publication where this model was introduced first.

__init__(img_channels=1, enc_channels=32)

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

forward(x)

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

training: bool
class Decoder(in_channels, out_shape)

Bases: vp_suite.base.base_model_block.VPModelBlock

This class implements a convolutional decoder.

NAME: str = 'Decoder'

The clear-text name for this model block.

__init__(in_channels, out_shape)

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

forward(x)

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

training: bool
class Encoder(in_channels, out_channels)

Bases: vp_suite.base.base_model_block.VPModelBlock

This class implements a convolutional encoder.

NAME: str = 'Encoder'

The clear-text name for this model block.

__init__(in_channels, out_channels)

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

forward(x)

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

training: bool