- class AEModule(*args, **kwargs)[source]
Bases:
torch.nn.Module
Auto Encoder Pytorch Module.
Methods
__call__
(*args, **kwargs)Call self as a function.
build
(numeric_fts, binary_fts, categorical_fts)Constructs the autoencoder model.
decode
(x[, layers])Decodes the input using the decoder layers and computes the outputs.
encode
(x[, layers])Encodes the input using the encoder layers.
forward
(input)Passes the input through the model and returns the outputs.
- build(numeric_fts, binary_fts, categorical_fts)[source]
Constructs the autoencoder model.
- Parameters:
- numeric_ftsList[str]
- binary_ftsList[str]
- categorical_ftsDict[str, Dict[str, List[str]]]
The names of the numeric features.
The names of the binary features.
The dictionary mapping categorical feature names to dictionaries containing the categories of the feature.
- decode(x, layers=None)[source]
Decodes the input using the decoder layers and computes the outputs.
- Parameters:
- xtorch.Tensor
- layersint, optional
The encoded input tensor to decode.
The number of layers to use for decoding. Defaults to None, will use all decoder layers.
- Returns:
- tuple of Union[torch.Tensor, List[torch.Tensor]]
A tuple containing the numeric (Tensor), binary (Tensor), and categorical outputs (List[torch.Tensor]) of the model.
- encode(x, layers=None)[source]
Encodes the input using the encoder layers.
- Parameters:
- xtorch.Tensor
- layersint, optional
The input tensor to encode.
The number of layers to use for encoding. Defaults to None, will use all encoder layers.
- Returns:
- torch.Tensor
The encoded output tensor.
- forward(input)[source]
Passes the input through the model and returns the outputs.
- Parameters:
- inputtorch.Tensor
The input tensor.
- Returns:
- tuple of Union[torch.Tensor, List[torch.Tensor]]
A tuple containing the numeric (Tensor), binary (Tensor), and categorical outputs (List[torch.Tensor]) of the model.