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.VPModelBlockThis class implements an autoencoder, consisting of a convolutional encoder and a decoder.
- __init__(img_shape, encoded_channels, device)
Initializes internal Module state, shared by both nn.Module and ScriptModule.
- build_models()
- decode(x)
- encode(x)
- class DCGANDecoder(out_size, img_channels=1, enc_channels=32)
Bases:
vp_suite.base.base_model_block.VPModelBlockThe class implements a DCGAN decoder, as introduced in Radford et al. (arxiv.org/abs/1511.06434).
- 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
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- class DCGANEncoder(img_channels=1, enc_channels=32)
Bases:
vp_suite.base.base_model_block.VPModelBlockThe class implements a DCGAN encoder, as introduced in Radford et al. (arxiv.org/abs/1511.06434).
- 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
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- class Decoder(in_channels, out_shape)
Bases:
vp_suite.base.base_model_block.VPModelBlockThis class implements a convolutional decoder.
- __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
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- class Encoder(in_channels, out_channels)
Bases:
vp_suite.base.base_model_block.VPModelBlockThis class implements a convolutional encoder.
- __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
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.