iVAE.agent.agent

class iVAE.agent.agent(adata: AnnData, layer: str = 'counts', percent: float = 0.01, irecon: float = 0.0, beta: float = 1.0, dip: float = 0.0, tc: float = 0.0, info: float = 0.0, hidden_dim: int = 128, latent_dim: int = 10, i_dim: int = 2, lr: float = 0.0001, device: device = device(type='cpu'))[source]

An agent class for modeling single-cell transcriptomics data using a variational autoencoder approach.

Parameters:
  • adata (AnnData) – Annotated data matrix.

  • layer (str, optional) – The layer of the AnnData object to use, by default ‘counts’.

  • percent (float, optional) – Percent parameter value, by default 0.01.

  • irecon (float, optional) – Irecon parameter value, by default 0.0.

  • beta (float, optional) – Beta parameter value, by default 1.0.

  • dip (float, optional) – Dip parameter value, by default 0.0.

  • tc (float, optional) – TC parameter value, by default 0.0.

  • info (float, optional) – Info parameter value, by default 0.0.

  • hidden_dim (int, optional) – Hidden dimension size, by default 128.

  • latent_dim (int, optional) – Latent dimension size, by default 10.

  • i_dim (int, optional) – I dimension size, by default 2.

  • lr (float, optional) – Learning rate, by default 1e-4.

  • device (torch.device, optional) – Device to run the model on, by default uses GPU if available, otherwise CPU.

fit(epochs=1000)[source]

Fits the model to the data for a specified number of epochs.

get_iembed()[source]

Returns the intermediate embedding from the neural network.

get_latent()[source]

Returns the latent representation of the data.

__init__(adata: AnnData, layer: str = 'counts', percent: float = 0.01, irecon: float = 0.0, beta: float = 1.0, dip: float = 0.0, tc: float = 0.0, info: float = 0.0, hidden_dim: int = 128, latent_dim: int = 10, i_dim: int = 2, lr: float = 0.0001, device: device = device(type='cpu'))[source]

Methods

__init__(adata[, layer, percent, irecon, ...])

fit([epochs])

Fits the model to the data for a specified number of epochs.

get_iembed()

Returns the intermediate embedding from the neural network.

get_latent()

Returns the latent representation of the data.

load_data()

step(data)

take_latent(state)

update(states)