wuziheng / cnn-numpy Goto Github PK
View Code? Open in Web Editor NEWInplement an CNN frame with Numpy, easy to learn, hard to use hhhh
Inplement an CNN frame with Numpy, easy to learn, hard to use hhhh
谢谢。发现一些错误跑步起来,就是python版本的问题引起的。
作者您好,请问您当时用lenet_layers跑出来的结果真的可以收敛吗 为啥我跑了将近20个epoch准确度只有10%
Hi,麻烦您解释一下在base_conv.py里面卷积的反向传播代码:flip_weights = np.flipud(np.fliplr(self.weights))
这里为什么需要左右上下翻转完了再进行reshape,谢谢啦
Hi,
请问可以解释一下为什么Conv2D中:
weights_scale = math.sqrt(reduce(lambda x, y: x * y, shape) / self.output_channels),
这个weights_scale的作用和它为什么这么计算吗?
首先,感谢作者的项目,学到了很多。
关于layers/fc.py的第42行self.bias -= alpha * self.bias,是否应该是self.bias -= alpha * self.b_gradient呢?
我还是认为,
pooling.py的79行,应该对self.index有一个清零的步骤,self.index = np.zeros(self.input_shape)
即:
forward(self, x):
out = np.zeros([x.shape[0], x.shape[1] / self.stride,
x.shape[2] / self.stride, self.output_channels])
self.index = np.zeros(self.input_shape)
for b in range(x.shape[0]):
............................
供讨论
楼主你好,因为conv的反向传播时计算梯度,就是用x的转置去乘上一层传递下来的梯度,为啥在fc里面变成了用上一层梯度乘x的转置呀。
就是如下代码,在fc的27行左右,为啥楼主你写的源代码如下:
col_x = self.x[i][:, np.newaxis]
eta_i = eta[i][:, np.newaxis].T
self.w_gradient += np.dot(col_x, eta_i)
而不是这样呀:
col_x = self.x[i][np.newaxis,:].T
eta_i = eta[i][np.newaxis,:]
self.w_gradient += np.dot(col_x, eta_i)
我刚试了一下下面这种方式也是可以正常训练的。所以我不知道是我矩阵梯度算错了,还是楼主不小心写错了,或者是两种方式都是可以的呢,希望楼主能解答一下疑惑,谢谢
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.