scglue.models.scglue.SCGLUETrainer
- class scglue.models.scglue.SCGLUETrainer(net, lam_data=None, lam_kl=None, lam_graph=None, lam_align=None, lam_sup=None, normalize_u=None, modality_weight=None, optim=None, lr=None, **kwargs)[source]
Bases:
GLUETrainer
Trainer for
SCGLUE
- Parameters
net (
scglue.models.scglue.SCGLUE
) –SCGLUE
network to be trainedlam_data (
typing.Optional
[float
]) – Data weightlam_kl (
typing.Optional
[float
]) – KL weightlam_graph (
typing.Optional
[float
]) – Graph weightlam_align (
typing.Optional
[float
]) – Adversarial alignment weightlam_sup (
typing.Optional
[float
]) – Cell type supervision weightnormalize_u (
typing.Optional
[bool
]) – Whether to L2 normalize cell embeddings before decodermodality_weight (
typing.Optional
[typing.Mapping
[str
,float
]]) – Relative modality weight (indexed by modality name)optim (
typing.Optional
[str
]) – Optimizerlr (
typing.Optional
[float
]) – Learning rate**kwargs – Additional keyword arguments are passed to the optimizer constructor
Methods
Compute loss functions
Format data tensors
A single training step
Attributes
BURNIN_NOISE_EXAG
freeze_u
Whether to freeze cell embeddings
logger