Backward function for nn Module

14 views
Skip to first unread message

Mridul Kavidayal

unread,
Feb 27, 2018, 6:50:01 AM2/27/18
to torch7
How are the gradients actually calculated? Is this a numerical algorithm or are the actual differentials used. Suppose, I create a nn Module which, in its forward pass, takes two inputs:
1) in image of size 3x256x256
2) a vector of gaussian samples of size 1x8. This is again generated by a network and to make this differential, reparameterization is used.

In this method (forward), I reshape the image to 11x256x256, wherein, the additional eight dimensions are the 1x8 vec expanded to 8x256x256. Therefore, the forward pass has a reshape operator followed by concat. How would the backward for this be implemented?


Reply all
Reply to author
Forward
0 new messages