Skip to content

Commit c5ec7a9

Browse files
Updated training tips and beta description
1 parent 071e16a commit c5ec7a9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

docs/training_tips.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ A few tips on training models
22
===================
33

44
trVAE
5-
- We recommend you to set `recon_loss` = `nb` or `zinb`. These loss functions require access to count and not normalized data. You need to have normalized log-transformed data in `adata.X` and raw count data in `adata.raw.X`. You also need to have normalization factors for each cell in `adata.obs[scale_factors]`. These normalization factors can be obtained with `scanpy.pp.normalize_total <https://github.com/theislab/scarches/blob/master/requirements.txt>`_ or other normalization methods such as `scran <https://bioconductor.org/packages/devel/bioc/vignettes/scran/inst/doc/scran.html>`_.
5+
- We recommend you to set `recon_loss` = `nb` or `zinb`. These loss functions require access to count data. You need to have raw count data in `adata.raw.X`.
66

7-
- If you don't have access to count data and have normalized data then set `recon_loss` to `mse`.
7+
- If you don't have access to count data and have normalized log-transformed data then set `recon_loss` to `mse`.
88

9-
- trVAE relies on an extra MMD term to force further integration of data sets. There is a parameter called `beta` (default=1) which regulates MMD effect in training. Higher values of `beta` will force extra mixing (might remove biological variation if too big!) while smaller values might result in less mixing (still batch effect). If you set `beta` = `0` the model reduces to a Vanilla CVAE.
9+
- trVAE relies on an extra MMD term to force further integration of data sets. There is a parameter called `beta` (default=1) which regulates MMD effect in training. Higher values of `beta` will force extra mixing (might remove biological variation if too big!) while smaller values might result in less mixing (still batch effect). If you set `beta` = `0` the model reduces to a Vanilla CVAE, but it is better to set 'use_mmd' to 'False' when MMD should not be used.
1010

1111
- It is important to use highly variable genes for training. We recommend to use at least 2000 HVGs and if you have more complicated datasets, conditions then try to increase it to 5000 or so to include enough information for the model.
1212

scarches/models/trvae/trvae.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class trVAE(nn.Module):
3636
recon_loss: String
3737
Definition of Reconstruction-Loss-Method, 'mse', 'nb' or 'zinb'.
3838
beta: Float
39-
Scaling Factor for MMD loss. Higher beta values results in stonger batch-correction at a cost of lossing bilogical varation.
39+
Scaling Factor for MMD loss. Higher beta values result in stronger batch-correction at a cost of worse biological variation.
4040
use_bn: Boolean
4141
If `True` batch normalization will be applied to layers.
4242
use_ln: Boolean

0 commit comments

Comments
 (0)