Closed milpan closed 3 years ago
Hello, please do not hesitate to reach if you need help with implementing custom layers.
Hello, please do not hesitate to reach if you need help with implementing custom layers.
Hey there mate! Sorry i didn't see your message a month ago!!! Really love this library, had a play around with it on some convolutional networks and the results were great! I'm working on obtaining FIM for the E2CNN library, at the moment ive managed to pull the fisher info out for the last fully connected layer of the network. Was trying to get it working with the R2 Conv Layer, but i think there's a big difference in implementation.
Also, cant thank u enough for reaching out! Kind Regards Matt
Hey!
If you want to add a new layer type, you need to implement per-example gradient computation in the generator, given the input of the layer, and the gradient w.r.t the output of the layer.
For linear layers it is quite easy (see e.g. https://github.com/tfjgeorge/nngeometry/blob/master/nngeometry/generator/jacobian.py#L802-L806), but it gets more complicated for more sophisticated ones.
I am closing this PR. Please reopen it if you want to implement per-example gradient computation for your new layers.
Updated to allow for R2 Convolutional layers