-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1) Various documentation improvements: - use proper RST syntax for warning/see-also panes. - set default role to `code` globally to better render `code blocks` in auto-generated pages. - change the `code` CSS style. - better document enums. - add some missing public enums to `stax`. - use RST :roles: and intersphinx to create clickable references to NT and JAX/numpy/etc objects. - Make `Kernel` public, and remove a circular dependency in typing -> Kernel -> utils -> typing. - Fix interactive python `>>>` code blocks to not create extra `>>>` or spaces when copy-pasting. - Add citations and references to all papers that contributed to NT. - Add basic `experimental` documentation. - Minor typing and linting fixes. 2) Fix a bug in the empirical kernel of grouped CNN, and add respective tests. 3) Add more tests to Tensorflow NTK, comparing TF and JAX NTKs. 4) Reduce some sizes to deflake tests. Tests: http://sponge2/fa1e9c8a-6fde-45d9-b301-93c7c47d28d8 PiperOrigin-RevId: 457065540
- Loading branch information
Showing
37 changed files
with
1,650 additions
and
940 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,39 @@ | ||
# Infinite width NTK/NNGP: | ||
@inproceedings{neuraltangents2020, | ||
title={Neural Tangents: Fast and Easy Infinite Neural Networks in Python}, | ||
author={Roman Novak and Lechao Xiao and Jiri Hron and Jaehoon Lee and Alexander A. Alemi and Jascha Sohl-Dickstein and Samuel S. Schoenholz}, | ||
booktitle={International Conference on Learning Representations}, | ||
year={2020}, | ||
pdf={https://arxiv.org/abs/1912.02803}, | ||
url={https://github.com/google/neural-tangents} | ||
} | ||
|
||
# Finite width, empirical NTK/NNGP: | ||
@inproceedings{novak2022fast, | ||
title={Fast Finite Width Neural Tangent Kernel}, | ||
author={Roman Novak and Jascha Sohl-Dickstein and Samuel S. Schoenholz}, | ||
booktitle={International Conference on Machine Learning}, | ||
year={2022}, | ||
pdf={https://arxiv.org/abs/2206.08720}, | ||
url={https://github.com/google/neural-tangents} | ||
} | ||
|
||
# Attention and variable-length inputs: | ||
@inproceedings{hron2020infinite, | ||
title={Infinite attention: NNGP and NTK for deep attention networks}, | ||
author={Jiri Hron and Yasaman Bahri and Jascha Sohl-Dickstein and Roman Novak}, | ||
booktitle={International Conference on Machine Learning}, | ||
year={2020}, | ||
pdf={https://arxiv.org/abs/2006.10540}, | ||
url={https://github.com/google/neural-tangents} | ||
} | ||
|
||
# Infinite-width "standard" parameterization: | ||
@misc{sohl2020on, | ||
title={On the infinite width limit of neural networks with a standard parameterization}, | ||
author={Jascha Sohl-Dickstein and Roman Novak and Samuel S. Schoenholz and Jaehoon Lee}, | ||
publisher = {arXiv}, | ||
year={2020}, | ||
pdf={https://arxiv.org/abs/2001.07301}, | ||
url={https://github.com/google/neural-tangents} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
.wy-nav-content { | ||
max-width: none; | ||
} | ||
|
||
.rst-content code.literal, .rst-content tt.literal { | ||
color: #404040; | ||
white-space: normal | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
:github_url: https://github.com/google/neural-tangents/tree/main/docs/experimental.rst | ||
|
||
|
||
|
||
`nt.experimental` -- prototypes | ||
====================================== | ||
|
||
.. warning:: | ||
This module contains new highly-experimental prototypes. Please beware that they are not properly tested, not supported, and may suffer from sub-optimal performance. Use at your own risk! | ||
|
||
.. automodule:: neural_tangents.experimental | ||
.. currentmodule:: neural_tangents.experimental | ||
|
||
Kernel functions | ||
-------------------------------------- | ||
Finite-width NTK kernel function *in Tensorflow*. See the `Python <https://github.com/google/neural-tangents/blob/main/examples/experimental/empirical_ntk_tf.py>`_ and `Colab <https://colab.research.google.com/github/google/neural-tangents/blob/main/notebooks/experimental/empirical_ntk_resnet_tf.ipynb>`_ usage examples. | ||
|
||
.. autofunction:: empirical_ntk_fn_tf | ||
|
||
Helper functions | ||
-------------------------------------- | ||
A helper function to convert Tensorflow stateful models into functional-style, stateless `apply_fn(params, x)` forward pass function and extract the respective `params`. | ||
|
||
.. autofunction:: get_apply_fn_and_params |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
:github_url: https://github.com/google/neural-tangents/tree/main/docs/kernel.rst | ||
|
||
.. default-role:: code | ||
|
||
`Kernel` dataclass | ||
|
||
:class:`~neural_tangents.Kernel` dataclass | ||
============================================================= | ||
|
||
.. automodule:: neural_tangents._src.utils.kernel | ||
.. autoclass:: neural_tangents.Kernel | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
:github_url: https://github.com/google/neural-tangents/tree/main/docs/monte_carlo.rst | ||
|
||
.. default-role:: code | ||
|
||
|
||
`nt.monte_carlo_kernel_fn` - MC Sampling | ||
========================================= | ||
|
||
.. default-role:: code | ||
|
||
.. automodule:: neural_tangents._src.monte_carlo | ||
.. automodule:: neural_tangents | ||
:members: monte_carlo_kernel_fn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.