frelam/MSAdapter:master-adapte-optimizer
into master
10 months ago
Deleting a branch is permanent. It CANNOT be undone. Continue?
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》
这里用step套在construct外层的原因是:
发现有一些用户的自定义优化器, 会重写step函数。在step函数中用到很多self.state[p] = xxx(修改类成员变量), p.add_下划线操作。 这部分实际上mindspore图模式是不能支持的。 不写在construct里头, 可以避免其进图。
如果construct套在step外头, 其实每一个子类优化器, 都需要这么写
比如sgd:
并不能复用construct函数。
hook类方法待实现。
在图模式下不支持该写法, 需要改成: ms.ops.assign(group['lr'], ms.Tensor(0.8))。
因为group['lr']是用一个parameter保存的, 如果换成常数, 将会变成常量, 对其修改不生效。
[WIP]master-adapte-optimizerto [2.1]master-adapte-optimizer 10 months ago是不是考虑只对外呈现我们支持的?
94420c1ca4
.