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)[源代码]
基类:
GLUETrainerTrainer for
SCGLUE- 参数:
net (
scglue.models.scglue.SCGLUE) –SCGLUEnetwork 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
方法
Compute loss functions
Format data tensors :rtype:
typing.Tuple[typing.Mapping[str,torch.Tensor],typing.Mapping[str,torch.Tensor],typing.Mapping[str,torch.Tensor],typing.Mapping[str,torch.Tensor],typing.Mapping[str,torch.Tensor],typing.Mapping[str,torch.Tensor],torch.Tensor,torch.Tensor,torch.Tensor]A single training step
属性
BURNIN_NOISE_EXAGfreeze_uWhether to freeze cell embeddings
logger