From 6c3e690d94e4931959c689b071f7028eb549a11c Mon Sep 17 00:00:00 2001 From: Mathew Shen Date: Tue, 19 Sep 2023 13:09:16 +0800 Subject: [PATCH] fix: docs (#19) --- docs/quickstart.md | 2 +- toydl/core/module.py | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/docs/quickstart.md b/docs/quickstart.md index af64702..2f53d1d 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -4,7 +4,7 @@ ## Binary Classification with MLP -??? MLPBinaryClassifyModel +??? "MLPBinaryClassifyModel" ```python from toydl.core.optim import SGD diff --git a/toydl/core/module.py b/toydl/core/module.py index e914b53..e3d5717 100644 --- a/toydl/core/module.py +++ b/toydl/core/module.py @@ -8,10 +8,6 @@ class Module: Modules form a tree that store parameters and other submodules. They make up the basis of neural network stacks. - Attributes: - _modules (dict): Storage of the child modules, mapping names to :class:`Module` objects. - _parameters (dict): Storage of the module's parameters, mapping names to :class:`Parameter` objects. - training (bool): Whether the module is in training mode or evaluation mode. """ def __init__(self): @@ -145,6 +141,7 @@ def update(self, x: Any): ??? warning 注意这里在`update`方法也调用了`self.value.requires_grad_(True)`方法来 + 确保参数更新后依然是叶子节点,保证可以累计梯度计算并进行参数更新 :param x: the parameter's new value """