VEncoder
- class aixd.mlmodel.architecture.encoders.VEncoder(in_heads: Dict[str, InHead], out_heads: Dict[str, OutHead], splits: Dict[str, Tuple[int, int]], layer_widths: List[int], latent_dim: int, activation: Module | str)[source]
Bases:
EncoderEncoder module of a conditional variational autoencoder with additional parameters for the latent distribution.
- Parameters:
in_heads (Dict[str, nn.Module]) – Dictionary of input heads, where the keys are strings and the values are PyTorch modules.
out_heads (Dict[str, nn.Module]) – Dictionary of output heads, where the keys are strings and the values are PyTorch modules.
splits (Dict[str, Tuple[int, int]]) – Start and end indices for each feature in the input data vectors.
layer_widths (List[int]) – List of integer values representing the widths of the hidden layers in the encoder.
latent_dim (int) – Integer value representing the latent dimension of the model.
activation (str) – String representing the activation function to be used in the hidden layers of the encoder.
Methods
Forward pass of the encoder.
Inherited Methods
Add a child module to the current module.
Apply
fnrecursively to every submodule (as returned by.children()) as well as self.Casts all floating point parameters and buffers to
bfloat16datatype.Return an iterator over module buffers.
Return an iterator over immediate children modules.
Compile this Module's forward using
torch.compile().Move all model parameters and buffers to the CPU.
Move all model parameters and buffers to the GPU.
Casts all floating point parameters and buffers to
doubledatatype.Set the module in evaluation mode.
Return the extra representation of the module.
Casts all floating point parameters and buffers to
floatdatatype.Return the buffer given by
targetif it exists, otherwise throw an error.Return any extra state to include in the module's state_dict.
Return the parameter given by
targetif it exists, otherwise throw an error.Return the submodule given by
targetif it exists, otherwise throw an error.Casts all floating point parameters and buffers to
halfdatatype.Move all model parameters and buffers to the IPU.
Copy parameters and buffers from
state_dictinto this module and its descendants.Return an iterator over all modules in the network.
Move all model parameters and buffers to the MTIA.
Return an iterator over module buffers, yielding both the name of the buffer as well as the buffer itself.
Return an iterator over immediate children modules, yielding both the name of the module as well as the module itself.
Return an iterator over all modules in the network, yielding both the name of the module as well as the module itself.
Return an iterator over module parameters, yielding both the name of the parameter as well as the parameter itself.
Return an iterator over module parameters.
Register a backward hook on the module.
Add a buffer to the module.
Register a forward hook on the module.
Register a forward pre-hook on the module.
Register a backward hook on the module.
Register a backward pre-hook on the module.
Register a post-hook to be run after module's
load_state_dict()is called.Register a pre-hook to be run before module's
load_state_dict()is called.Alias for
add_module().Add a parameter to the module.
Register a post-hook for the
state_dict()method.Register a pre-hook for the
state_dict()method.Change if autograd should record operations on parameters in this module.
Set extra state contained in the loaded state_dict.
Set the submodule given by
targetif it exists, otherwise throw an error.See
torch.Tensor.share_memory_().Return a dictionary containing references to the whole state of the module.
Prints a summary of a PyTorch model, including the number of parameters, the layers, their names, and the dimensionality.
Move and/or cast the parameters and buffers.
Move the parameters and buffers to the specified device without copying storage.
Set the module in training mode.
Casts all parameters and buffers to
dst_type.Move all model parameters and buffers to the XPU.
Reset gradients of all model parameters.