vzhou842 / cnn-from-scratch

A Convolutional Neural Network implemented from scratch (using only numpy) in Python.
https://victorzhou.com/blog/intro-to-cnns-part-1/
MIT License
279 stars 100 forks source link

Using 2 Conv Layer #3

Open ShoaibSajid opened 2 years ago

ShoaibSajid commented 2 years ago

Hello.

Thank for such an amazing code. It has helped me a lot in understanding.

I am trying to add another Conv layer. I was able to change conv to a 3d conv layer. The forward propagation works fine. but in backward propagation, I am unable to pass derivatives from one conv layer to the other.

Is it possible for you to show me how I can calculate dL/dInput for the conv layer. (the gradient which will be passed from second conv layer to the first conv layer during backpropagation)

zitongbai commented 10 months ago

Hello.

Thank for such an amazing code. It has helped me a lot in understanding.

I am trying to add another Conv layer. I was able to change conv to a 3d conv layer. The forward propagation works fine. but in backward propagation, I am unable to pass derivatives from one conv layer to the other.

Is it possible for you to show me how I can calculate dL/dInput for the conv layer. (the gradient which will be passed from second conv layer to the first conv layer during backpropagation)

You may refer to my fork, where I have implemented multi-channel input for Conv3x3 and refined the computation of backward propagation. This enhancement enables the realization of multi-layer CNN neural networks.