Skip to content

Commit

Permalink
add 4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
ShusenTang committed Mar 14, 2019
1 parent b85dc22 commit 878782d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/chapter04_DL_computation/4.3_deferred-init.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# 4.3 模型参数的延后初始化

由于使用Gluon创建的全连接层的时候不需要指定输入个数。所以当调用`initialize`函数时,由于隐藏层输入个数依然未知,系统也无法得知该层权重参数的形状。只有在当形状已知的输入`X`传进网络做前向计算`net(X)`时,系统才推断出该层的权重参数形状为多少,此时才进行真正的初始化操作。但是使用PyTorch在定义模型的时候就要指定输入的形状,所以也就不存在这个问题了,所以本节略。有兴趣的可以去看看原文,[传送门](https://zh.d2l.ai/chapter_deep-learning-computation/deferred-init.html)

0 comments on commit 878782d

Please sign in to comment.