scvi.module.Classifier#
- class scvi.module.Classifier(n_input, n_hidden=128, n_labels=5, n_layers=1, dropout_rate=0.1, logits=False, use_batch_norm=True, use_layer_norm=False, activation_fn=<class 'torch.nn.modules.activation.ReLU'>, **kwargs)[source]#
Bases:
Module
Basic fully-connected NN classifier.
- Parameters:
n_input (
int
) – Number of input dimensionsn_hidden (
int
(default:128
)) – Number of nodes in hidden layer(s). If 0, the classifier only consists of a single linear layer.n_labels (
int
(default:5
)) – Numput of outputs dimensionsn_layers (
int
(default:1
)) – Number of hidden layers. If 0, the classifier only consists of a single linear layer.dropout_rate (
float
(default:0.1
)) – dropout_rate for nodeslogits (
bool
(default:False
)) – Return logits or notuse_batch_norm (
bool
(default:True
)) – Whether to use batch norm in layersuse_layer_norm (
bool
(default:False
)) – Whether to use layer norm in layersactivation_fn (
Module
(default:<class 'torch.nn.modules.activation.ReLU'>
)) – Valid activation function from torch.nn**kwargs – Keyword arguments passed into
FCLayers
.
Attributes table#
Methods table#
|
Forward computation. |
Attributes#
- Classifier.training: bool#