google-deepmind / dm-haiku

JAX-based neural network library
https://dm-haiku.readthedocs.io
Apache License 2.0
2.91k stars 231 forks source link

Document Typo #663

Closed keep9oing closed 1 year ago

keep9oing commented 1 year ago

https://dm-haiku.readthedocs.io/en/latest/notebooks/parameter_sharing.html

I'm following the tutorial on parameter sharing in the document.

The last example code has some typos I think..

wrapper = Wrapper()
transformed_f = hk.transform(wrapper.f)
params_f = transformed_f.init(rng, x)
transformed_g = hk.transform(wrapper.f)
params_g = transformed_g.init(rng, x)

should be

wrapper = Wrapper()
transformed_f = hk.transform(wrapper.f)
params_f = transformed_f.init(rng, x)
transformed_g = hk.transform(wrapper.g)
params_g = transformed_g.init(rng, x)

wrapper.f->wrapper.g.