scxpand.autoencoders.ae_model_output#
Classes
|
Container for autoencoder decoder outputs. |
|
Container for autoencoder model outputs. |
- class scxpand.autoencoders.ae_model_output.DecoderOutput(mu, pi=None, theta=None)#
Container for autoencoder decoder outputs.
This class standardizes the decoder outputs, making the interface cleaner and more explicit about which outputs are available.
The decoder handles all transformations internally and returns processed values.
- Variables:
mu – Mean parameter after inverse transforms to match row-normalized target scale [batch_size, n_genes]
pi – Dropout probability [batch_size, n_genes] (optional, only for ZINB)
theta – Dispersion parameter [batch_size, n_genes] (optional, only for NB/ZINB, positive values)
- __init__(mu, pi=None, theta=None)#
- detach()#
Detach all tensors from the computation graph.
- Return type:
- to(device)#
Move all tensors to the specified device.
- Return type:
- class scxpand.autoencoders.ae_model_output.ModelOutput(latent_vec, mu, class_logit, pi=None, theta=None, categorical_logits=None)#
Container for autoencoder model outputs.
This class standardizes outputs from all autoencoder model variants, making code more maintainable and error handling more robust. It replaces the tuple return type with a proper object that has named attributes.
- Variables:
latent_vec – Encoded latent vector from encoder [batch_size, latent_dim]
mu – Mean parameter after inverse transforms to match row-normalized target scale [batch_size, n_genes]
class_logit – Classification logit [batch_size]
pi – Dropout probability [batch_size, n_genes] (optional, only for ZINB)
theta – Dispersion parameter [batch_size, n_genes] (optional, only for NB/ZINB, positive values)
categorical_logits – Dict of categorical feature logits (optional) {feature_name: [batch_size, n_classes]}
- __init__(latent_vec, mu, class_logit, pi=None, theta=None, categorical_logits=None)#
- cpu()#
- Return type:
- detach()#
Detach all tensors from the computation graph.
- Return type:
- to(device)#
Move all tensors to the specified device.
- Return type: