qbm4eo.encoder module
This file is a part of qbm4eo.rst project.
https://github.com/FeralQubits/qbm4eo
It has been modified as a part of the EuroHPC PL project funded at the Smart Growth Operational Programme 2014-2020, Measure 4.2 under the grant agreement no. POIR.04.02.00-00-D014/20-00.
- class qbm4eo.encoder.LBAEEncoder(input_size: Tuple[int, ...], out_channels: int, latent_space_size: int, num_layers: int, *args: Dict[str, Any], quantize: bool, negative_slope: float = 0.02, bias: bool = False, **kwargs: Dict[str, Any])[source]
Bases:
ModuleA class implementing the encoder of the LBAE model.
A default constructor for the LBAEEncoder class.
- Parameters:
input_size – The size of the input image.
out_channels – The number of channels in the output image.
latent_space_size – The size of the latent space.
num_layers – The number of layers in the encoder.
- class qbm4eo.encoder.QuantizerFunc(*args, **kwargs)[source]
Bases:
FunctionA class implementing the quantizer function.
- Note:
This class is used to implement the quantizer function as a PyTorch autograd function. This is done to allow the quantizer function to be used in the forward pass of the LBAE model.
- Note:
The forward and backward methods do not match signatures of their base methods.
- class qbm4eo.encoder.ResBlockConv(channels: int, *args: Dict[str, Any], in_channels: int | None = None, negative_slope: float = 0.02, bias: bool = False, **kwargs: Dict[str, Any])[source]
Bases:
ModuleA class implementing a residual block for convolutional layers.
A default constructor for the ResBlockConv class.
- Parameters:
channels – The number of channels of the output tensors.
in_channels – The number of channels of the input tensor. If None, then the number of channels of the input tensor is assumed to be equal to the number of channels of the output tensor.
negative_slope – The negative slope of the LeakyReLU activation function.
bias – A boolean flag indicating whether to use a bias term in the convolutional layer.
- class qbm4eo.encoder.ResBlockConvPart(channels: int, *args: Dict[str, Any], negative_slope: float = 0.02, bias: bool = False, **kwargs: Dict[str, Any])[source]
Bases:
ModuleA class implementing a single part of a residual block for convolutional layers.
A default constructor for the ResBlockConvPart class.
- Parameters:
channels – The number of channels of the input and output tensors.
negative_slope – The negative slope of the LeakyReLU activation function.
bias – A boolean flag indicating whether to use a bias term in the convolutional layer.
args – Additional positional arguments.
kwargs – Additional keyword arguments.