scimilarity.nn_models#
This file contains the neural network architectures. These are all you need for inference.
- class scimilarity.nn_models.Decoder(n_genes, latent_dim=128, hidden_dim=[1024, 1024], dropout=0.5, residual=False)[source]#
Bases:
Module
A class that encapsulates the decoder.
- Parameters:
n_genes (int) –
latent_dim (int) –
hidden_dim (List[int]) –
dropout (float) –
residual (bool) –
- forward(x)[source]#
Forward.
- Parameters:
x (torch.Tensor) – Input tensor corresponding to input layer.
- Returns:
Output tensor corresponding to output layer.
- Return type:
torch.Tensor
- class scimilarity.nn_models.Encoder(n_genes, latent_dim=128, hidden_dim=[1024, 1024], dropout=0.5, input_dropout=0.4, residual=False)[source]#
Bases:
Module
A class that encapsulates the encoder.
- Parameters:
n_genes (int) –
latent_dim (int) –
hidden_dim (List[int]) –
dropout (float) –
input_dropout (float) –
residual (bool) –
- forward(x)[source]#
Forward.
- Parameters:
x (torch.Tensor) – Input tensor corresponding to input layer.
- Returns:
Output tensor corresponding to output layer.
- Return type:
torch.Tensor