Config
LossType = TypeVar('LossType')
module-attribute
损失函数的占位符;无约束。
ModelOutput = TypeVar('ModelOutput', Tensor, list[Tensor], tuple[Tensor], dict[str, Tensor], covariant=True)
module-attribute
模型的正向传播可能产生张量、多个张量或命名张量。
ModelType = TypeVar('ModelType', bound=Model)
module-attribute
具有正向传播的事物的通用类型。
BionemoModelConfig
基类: Generic[ModelType]
, ABC
模型配置的抽象类。
源代码在 bionemo/core/model/config.py
中
54 55 56 57 58 59 60 |
|
configure_model(*args, **kwargs)
abstractmethod
配置模型。
源代码在 bionemo/core/model/config.py
中
57 58 59 60 |
|
BionemoTrainableModelConfig
基类: Generic[ModelType, LossType]
, BionemoModelConfig[ModelType]
可训练模型配置的抽象类。
源代码在 bionemo/core/model/config.py
中
63 64 65 66 67 68 69 |
|
get_loss_reduction_class()
abstractmethod
返回损失缩减类。
源代码在 bionemo/core/model/config.py
中
66 67 68 69 |
|
Model
基类: Protocol[ModelOutput]
模型的轻量级接口:必须具有 forward 方法。
源代码在 bionemo/core/model/config.py
中
41 42 43 44 45 46 |
|
forward(*args, **kwargs)
模型的预测/前向步骤。
源代码在 bionemo/core/model/config.py
中
44 45 46 |
|