flax icon indicating copy to clipboard operation
flax copied to clipboard

Add perturb() to allow capturing intermediate gradients

Open IvyZX opened this issue 3 years ago • 2 comments

Add a perturb() function in nn.Module, which could be used to capture the intermediate gradients inside a module's call.

See example in the docstring. There will be a future Colab/notebook with better examples.

IvyZX avatar Sep 22 '22 21:09 IvyZX

Looks good! Should we add a simple test?

cgarciae avatar Sep 22 '22 22:09 cgarciae

Looks good! Should we add a simple test?

Test added!

IvyZX avatar Sep 23 '22 00:09 IvyZX

@IvyZX @levskaya we forgot to add this new method to the sphinx page in docs/api_reference/flax.linen.rst, its currently not being rendered.

cgarciae avatar Sep 27 '22 18:09 cgarciae