-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Questions #1
Comments
神经网络参数值初始化,这个部分我没有在专栏介绍.参考论文是何凯明的msra初始化方法、当然还有常用的xavier也可以、使用好的初始化能极大加速网络收敛.减少loss直接跑飞的情况.顺便回答一下为什么:论文的出发点是为了保证数据经过层的传输后标准差没有显著的变大或变小、否则bp的过程梯度会反方向变化、从而容易导致爆炸或消失 |
你看的应该是早期的版本了、在最新版本中、我专门实现了initializer的函数、可供选择、但一般这个问题放在比较后面、实际中网络跑飞了、这个是排查的优先级比较低、而且现在可选的不多、所以我没有专门介绍 |
谢谢回答。 |
tensor/Operator.py里面实现了Conv2D的类 |
欢迎参考我在知乎写的专栏、完整地介绍了所有的实现和代码细节、希望可以帮助到你 |
根据softmax的公式,按照我的理解,self.loss += np.log(np.sum(np.exp(prediction[i]))) - prediction[i] 应该是这样的啊,为什么您用的是prediction[i, label[i]]呢? |
你理解的没错,但是prediction是一整个batch的结果,prediction[i,label[i]]计算的是第i个数据的Loss,所以这里有一个for循环。注意整个代码中流动的数据第一个维度都是batch |
根据Adam的更新公式,self.data -= learning_rate_t * self.m_t / ((self.v_t ) **0.5+self.epsilon)吧,为什么你的代码里是self.data -= learning_rate_t * self.m_t / (self.v_t + self.epsilon) ** 0.5。我没有找到Adam中关于learning rate更新的公式,作者可以给个参考的文章链接吗? |
xxxxx\CNN-Numpy-master\tensor\util.py", line 13, in initializer |
from functools import reduce |
https://www.runoob.com/python/python-func-reduce.html
https://docs.python.org/zh-cn/3/library/functools.html
希望可以帮到你
…------------------ Original message ------------------
From: "caoqi95";
Sendtime: Wednesday, Sep 4, 2019 3:32 PM
To: "wuziheng/CNN-Numpy";
Cc: "Butterfly "<694790961@qq.com>; "Comment";
Subject: Re: [wuziheng/CNN-Numpy] Questions (#1)
xxxxx\CNN-Numpy-master\tensor\util.py", line 13, in initializer
weights_scale = math.sqrt(reduce(lambda x, y: x * y, shape) / shape[-1])
NameError: name 'reduce' is not defined
请问这个reduce是哪里的函数啊
from functools import reduce
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
lenet_layers.py 和 lenet_tensor.py 哪个更新啊?区别在哪里啊?我lenet_layers.py 可以跑了。 |
请问你 lenet_layers.py 中 stride=2 的时候也能跑的通吗? |
Hi,
请问可以解释一下为什么Conv2D中:
weights_scale = math.sqrt(reduce(lambda x, y: x * y, shape) / self.output_channels),
这个weights_scale的作用和它为什么这么计算吗?
The text was updated successfully, but these errors were encountered: