scvi._settings.ScviConfig#

class scvi._settings.ScviConfig(verbosity=20, progress_bar_style='tqdm', batch_size=128, seed=None, logging_dir='./scvi_log/', dl_num_workers=0, dl_persistent_workers=False, warnings_stacklevel=2, mlflow_set_tracking_uri='', mlflow_set_experiment='mlflow_experiment')[source]#

Config manager for scvi-tools.

Examples

To set the seed

>>> scvi.settings.seed = 1

To set the batch size for functions like SCVI.get_latent_representation

>>> scvi.settings.batch_size = 1024

To set the progress bar style, choose one of “rich”, “tqdm”

>>> scvi.settings.progress_bar_style = "rich"

To set the verbosity

>>> import logging
>>> scvi.settings.verbosity = logging.INFO

To set the number of threads, PyTorch will use

>>> scvi.settings.num_threads = 2

Attributes table#

batch_size

Minibatch size for loading data into the model.

dl_num_workers

Number of workers for PyTorch data loaders (Default is 0).

dl_persistent_workers

Whether to use persistent_workers in PyTorch data loaders (Default is False).

logging_dir

Directory for training logs (default './scvi_log/').

mlflow_set_experiment

Setting the MLFlow experiment name

mlflow_set_tracking_uri

Setting the MLFlow tracking URI.

num_threads

Number of threads PyTorch will use.

progress_bar_style

Library to use for progress bar.

seed

Random seed for torch and numpy.

verbosity

Verbosity level (default logging.INFO).

warnings_stacklevel

Stacklevel for warnings.

Methods table#

reset_logging_handler()

Resets "scvi" log handler to a basic RichHandler().

Attributes#

ScviConfig.batch_size[source]#

Minibatch size for loading data into the model.

This is only used after a model is trained. Trainers have specific batch_size parameters.

ScviConfig.dl_num_workers[source]#

Number of workers for PyTorch data loaders (Default is 0).

ScviConfig.dl_persistent_workers[source]#

Whether to use persistent_workers in PyTorch data loaders (Default is False).

ScviConfig.logging_dir[source]#

Directory for training logs (default ‘./scvi_log/’).

ScviConfig.mlflow_set_experiment[source]#

Setting the MLFlow experiment name

ScviConfig.mlflow_set_tracking_uri[source]#

Setting the MLFlow tracking URI. Setting it will cause to also use it

ScviConfig.num_threads[source]#

Number of threads PyTorch will use.

ScviConfig.progress_bar_style[source]#

Library to use for progress bar.

ScviConfig.seed[source]#

Random seed for torch and numpy.

ScviConfig.verbosity[source]#

Verbosity level (default logging.INFO).

ScviConfig.warnings_stacklevel[source]#

Stacklevel for warnings.

Methods#

ScviConfig.reset_logging_handler()[source]#

Resets “scvi” log handler to a basic RichHandler().

This is useful if piping outputs to a file.