scvi.module.base.EmbeddingModuleMixin#

class scvi.module.base.EmbeddingModuleMixin[source]#

Bases: object

EXPERIMENTAL Mixin class for initializing and using embeddings in a module.

Notes

Lifecycle: experimental in v1.2.

Attributes table#

embeddings_dict

Dictionary of embeddings.

Methods table#

add_embedding(key, embedding[, overwrite])

Add an embedding to the module.

compute_embedding(key, indices)

Forward pass for an embedding.

get_embedding(key)

Get an embedding from the module.

init_embedding(key, num_embeddings[, ...])

Initialize an embedding in the module.

remove_embedding(key)

Remove an embedding from the module.

Attributes#

EmbeddingModuleMixin.embeddings_dict[source]#

Dictionary of embeddings.

Methods#

EmbeddingModuleMixin.add_embedding(key, embedding, overwrite=False)[source]#

Add an embedding to the module.

Return type:

None

EmbeddingModuleMixin.compute_embedding(key, indices)[source]#

Forward pass for an embedding.

Return type:

Tensor

EmbeddingModuleMixin.get_embedding(key)[source]#

Get an embedding from the module.

Return type:

Embedding

EmbeddingModuleMixin.init_embedding(key, num_embeddings, embedding_dim=5, **kwargs)[source]#

Initialize an embedding in the module.

Return type:

None

EmbeddingModuleMixin.remove_embedding(key)[source]#

Remove an embedding from the module.

Return type:

None