xieyuheng / learner

A machine learning library learned from "The Little Learner".
GNU General Public License v3.0
3 stars 1 forks source link

system-a 中,梯度下降的循环中,梯度的 shape 与参数的 shape 不一致。 #2

Open xieyuheng opened 4 months ago

xieyuheng commented 4 months ago

训练鸢尾花的模型时,在循环中打印所求梯度,可以发现这一现象。

训练的结果不好,因为所得的梯度中有很多是 0。

需要单独测试梯度函数来看看是不是因为 target 函数没有返回标量导致的。

也可能是因为 extend2 用了 shape 而没有用 tlen,因此与书中不一致,导致的。

xieyuheng commented 4 months ago

原来是 "dying ReLU" problem,哈哈哈:

更多: