# Imputation/Denoise output

**URL:** https://discourse.scverse.org/t/imputation-denoise-output/3913
**Category:** scvi-tools
**Tags:** scvi
**Created:** [January 15, 2026, 4:41am UTC](https://discourse.scverse.org/t/imputation-denoise-output/3913 "2026-01-15T04:41:22Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Huiyueli](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/huiyueli/32/1568_2.png) [@Huiyueli](https://discourse.scverse.org/u/Huiyueli)
#### Post date: [January 15, 2026, 4:41am UTC](https://discourse.scverse.org/t/imputation-denoise-output/3913/1 "2026-01-15T04:41:22Z")

</div>

When using the code below for data denoise/imputation, how to set the library\_size in get\_normalized\_expression()? to obtain the output in count-scale, rather than normalized output?

scvi.model.SCVI.setup\_anndata(adata,layer=“counts”)  
vae = scvi.model.SCVI(adata)  
vae.train()  
vae.get\_latent\_representation()  
vae.get\_normalized\_expression()

Also, are there any recommendations for parameters in vae.train(),e.g., max\_epochs and train\_size=0.9; as well as n\_samples in get\_normalized\_expression()?

If I have multiple samples in adata, may I input the whole dataset together to do denoise? or do denoise for each sample, then combine the results?

Thank you!

---

<div class="post-metadata">

### Author: ![ori-kron-wis](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/ori-kron-wis/32/1099_2.png) [@ori-kron-wis](https://discourse.scverse.org/u/ori-kron-wis)
#### Post date: [January 15, 2026, 7:22am UTC](https://discourse.scverse.org/t/imputation-denoise-output/3913/2 "2026-01-15T07:22:32Z")

</div>

You can use `library_size=“latent”` in `get_normalized_expression` to get count-like output, which is the “closest” to the denoised real counts.

Recommended parameters for training really depend on the problem, we set the default max\_epochs=400 and train\_size=0.9, batch size should be optimal for your GPU memory. But it doesnt have to be like this. What you care about is for model convergence and that it is not overfitting. You can use `early stopping` for this. See our different [tutorials](https://docs.scvi-tools.org/en/latest/index.html) for reference. Increasing `n_samples` will result in more accurate outputs, but will take more time.

You should use sample\_id as `batch_key` when setup the SCVI model, and denoise them jointly (unless the samples really differ in their genes/from different tissues or census completely - there are other models for that).
