scvi.module.MULTIVAE#
- class scvi.module.MULTIVAE(n_input_regions=0, n_input_genes=0, n_input_proteins=0, modality_weights='equal', modality_penalty='Jeffreys', n_batch=0, n_obs=0, n_labels=0, gene_likelihood='zinb', gene_dispersion='gene', n_hidden=None, n_latent=None, n_layers_encoder=2, n_layers_decoder=2, n_continuous_cov=0, n_cats_per_cov=None, dropout_rate=0.1, region_factors=True, use_batch_norm='none', use_layer_norm='both', latent_distribution='normal', deeply_inject_covariates=False, encode_covariates=False, use_size_factor_key=False, protein_background_prior_mean=None, protein_background_prior_scale=None, protein_dispersion='protein')[source]#
Bases:
BaseModuleClass
Variational auto-encoder model for joint paired + unpaired RNA-seq and ATAC-seq data.
- Parameters:
n_input_regions (int) – Number of input regions.
n_input_genes (int) – Number of input genes.
n_input_proteins (int) – Number of input proteins
modality_weights (Tunable_[Literal['equal', 'cell', 'universal']]) – Weighting scheme across modalities. One of the following: *
"equal"
: Equal weight in each modality *"universal"
: Learn weights across modalities w_m. *"cell"
: Learn weights across modalities and cells. w_{m,c}modality_penalty (Tunable_[Literal['Jeffreys', 'MMD', 'None']]) – Training Penalty across modalities. One of the following: *
"Jeffreys"
: Jeffreys penalty to align modalities *"MMD"
: MMD penalty to align modalities *"None"
: No penaltyn_batch (int) – Number of batches, if 0, no batch correction is performed.
gene_likelihood (Tunable_[Literal['zinb', 'nb', 'poisson']]) – The distribution to use for gene expression data. One of the following *
'zinb'
- Zero-Inflated Negative Binomial *'nb'
- Negative Binomial *'poisson'
- Poissongene_dispersion (Tunable_[Literal['gene', 'gene-batch', 'gene-label', 'gene-cell']]) – One of the following: *
'gene'
- dispersion parameter of NB is constant per gene across cells *'gene-batch'
- dispersion can differ between different batches *'gene-label'
- dispersion can differ between different labels *'gene-cell'
- dispersion can differ for every gene in every cellprotein_dispersion (str) –
One of the following:
'protein'
- protein_dispersion parameter is constant per protein across cells'protein-batch'
- protein_dispersion can differ between different batches NOT TESTED'protein-label'
- protein_dispersion can differ between different labels NOT TESTED
n_hidden (Tunable_[int]) – Number of nodes per hidden layer. If
None
, defaults to square root of number of regions.n_latent (Tunable_[int]) – Dimensionality of the latent space. If
None
, defaults to square root ofn_hidden
.n_layers_encoder (Tunable_[int]) – Number of hidden layers used for encoder NN.
n_layers_decoder (Tunable_[int]) – Number of hidden layers used for decoder NN.
dropout_rate (Tunable_[float]) – Dropout rate for neural networks
region_factors (Tunable_[bool]) – Include region-specific factors in the model
use_batch_norm (Tunable_[Literal['encoder', 'decoder', 'none', 'both']]) – One of the following *
'encoder'
- use batch normalization in the encoder only *'decoder'
- use batch normalization in the decoder only *'none'
- do not use batch normalization *'both'
- use batch normalization in both the encoder and decoderuse_layer_norm (Tunable_[Literal['encoder', 'decoder', 'none', 'both']]) – One of the following *
'encoder'
- use layer normalization in the encoder only *'decoder'
- use layer normalization in the decoder only *'none'
- do not use layer normalization *'both'
- use layer normalization in both the encoder and decoderlatent_distribution (Tunable_[Literal['normal', 'ln']]) – which latent distribution to use, options are *
'normal'
- Normal distribution *'ln'
- Logistic normal distribution (Normal(0, I) transformed by softmax)deeply_inject_covariates (Tunable_[bool]) – Whether to deeply inject covariates into all layers of the decoder. If False, covariates will only be included in the input layer.
encode_covariates (Tunable_[bool]) – If True, include covariates in the input to the encoder.
use_size_factor_key (bool) – Use size_factor AnnDataField defined by the user as scaling factor in mean of conditional RNA distribution.
n_obs (int) –
n_labels (int) –
n_continuous_cov (int) –
Attributes table#
Methods table#
|
Runs the generative model. |
Computes the reconstruction loss for the accessibility data. |
|
Computes the reconstruction loss for the expression data. |
|
|
Run the inference model. |
|
Computes the loss function for the model. |
Attributes#
training
Methods#
generative
- MULTIVAE.generative(z, qz_m, batch_index, cont_covs=None, cat_covs=None, libsize_expr=None, size_factor=None, use_z_mean=False, label=None)[source]#
Runs the generative model.
- Parameters:
label (Tensor) –
get_reconstruction_loss_accessibility
- MULTIVAE.get_reconstruction_loss_accessibility(x, p, d)[source]#
Computes the reconstruction loss for the accessibility data.
get_reconstruction_loss_expression
- MULTIVAE.get_reconstruction_loss_expression(x, px_rate, px_r, px_dropout)[source]#
Computes the reconstruction loss for the expression data.
inference
- MULTIVAE.inference(x, y, batch_index, cont_covs, cat_covs, label, cell_idx, n_samples=1)[source]#
Run the inference model.
loss