Skip to content

Commit 7f43f20

Browse files
authored
Merge pull request #208 from LabForComputationalVision/cleanup_tutorials
Cleanup tutorials
2 parents 7cb62b6 + 4583c0e commit 7f43f20

40 files changed

+1544
-1026
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ jobs:
148148
- uses: actions/checkout@v3
149149
- name: Check for file
150150
shell: bash
151-
run: if [[ -z "$(grep ${{ matrix.notebook }} docs/tutorials/*nblink)" ]] ; then
151+
# there are two levels that the notebooks can be in
152+
run: if [[ -z "$(grep ${{ matrix.notebook }} docs/tutorials/*nblink)" && -z "$(grep ${{ matrix.notebook }} docs/tutorials/*/*nblink)" ]] ; then
152153
exit 1; fi
153154
no_extra_nblinks:
154155
runs-on: ubuntu-latest
@@ -159,6 +160,7 @@ jobs:
159160
shell: bash
160161
run: |
161162
n_nblink=0; for file in docs/tutorials/*nblink; do let "n_nblink+=1"; done;
163+
for file in docs/tutorials/*/*nblink; do let "n_nblink+=1"; done;
162164
n_ipynb=0; for file in examples/*ipynb; do let "n_ipynb+=1"; done;
163165
if [[ $n_nblink != $n_ipynb ]]; then exit 1; fi;
164166

CONTRIBUTING.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -416,9 +416,9 @@ make html
416416

417417
We build tutorials as Jupyter notebooks so that they can be launched in Binder
418418
and people can play with them on their local machine. In order to include them
419-
in the built docs, add a `nblink` file to the `docs/tutorials/` directory. We
420-
check for this during the tests, so you won't be able to merge your pull request
421-
into `main` unless you've done this!
419+
in the built docs, add a `nblink` file to the `docs/tutorials/` directory or one
420+
of its sub-directories. We check for this during the tests, so you won't be able
421+
to merge your pull request into `main` unless you've done this!
422422

423423
This is a json file that should contain the path to the notebook, like so, for
424424
`docs/tutorials/my_awesome_tutorial.nblink`:
@@ -430,7 +430,9 @@ This is a json file that should contain the path to the notebook, like so, for
430430
```
431431

432432
note that you *cannot* have a trailing comma there, because json is very
433-
particular.
433+
particular. And note that the number of `../` you need will depend on whether
434+
the `nblink` file lives in `docs/tutorials/` or one of its sub-directories.
435+
434436
If you have extra media (such as images) that are rendered in the notebook, you
435437
need to specify them as well, otherwise they won't render in the documentation:
436438

@@ -444,8 +446,13 @@ need to specify them as well, otherwise they won't render in the documentation:
444446

445447
note that `extra-media` must be a list, even with a single path.
446448

447-
See the [nbsphinx-link](https://github.com/vidartf/nbsphinx-link)
448-
page for more details.
449+
See the [nbsphinx-link](https://github.com/vidartf/nbsphinx-link) page for more
450+
details.
451+
452+
The location of the `.nblink` file (in `docs/tutorials`, `docs/tutorials/intro`,
453+
etc.) determines which of the sub-headings it appears under in the table of
454+
contents. View the `toctree` directives at the bottom of `index.rst` to see
455+
which subfolders corresponds to which
449456

450457
*NOTE*: In order for the `toctree` formatting to work correctly, your notebook
451458
should have exactly one H1 title (i.e., line starting with a single `#`), but

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ experiments for further investigation.
2525
for an in-depth introduction.
2626
- If you understand the basics of synthesis and want to get started
2727
using `plenoptic` quickly, see the
28-
[Quickstart](tutorials/00_quickstart.nblink) tutorial.
28+
[Quickstart](examples/00_quickstart.ipynb) tutorial.
2929

3030
### Installation
3131

@@ -60,18 +60,18 @@ with a random string, `matplotlib` will tell you the available choices.
6060

6161
![](docs/images/example_synth.svg)
6262

63-
- [Metamers](tutorials/06_Metamer.nblink): given a model and a
63+
- [Metamers](examples/06_Metamer.ipynb): given a model and a
6464
reference image, stochastically generate a new image whose model
6565
representation is identical to that of the reference image. This
6666
method investigates what image features the model disregards
6767
entirely.
68-
- [Eigendistortions](tutorials/02_Eigendistortions.nblink): given a
68+
- [Eigendistortions](examples/02_Eigendistortions.ipynb): given a
6969
model and a reference image, compute the image perturbation that
7070
produces the smallest and largest changes in the model response
7171
space. This method investigates the image features the model
7272
considers the least and most important.
7373
- [Maximal differentiation (MAD)
74-
competition](tutorials/07_MAD_Competition.nblink): given two metrics
74+
competition](examples/07_MAD_Competition.ipynb): given two metrics
7575
that measure distance between images and a reference image, generate
7676
pairs of images that optimally differentiate the models.
7777
Specifically, synthesize a pair of images that the first model says
@@ -80,7 +80,7 @@ with a random string, `matplotlib` will tell you the available choices.
8080
a second pair with the roles of the two models reversed. This method
8181
allows for efficient comparison of two metrics, highlighting the
8282
aspects in which their sensitivities differ.
83-
- [Geodesics](tutorials/05_Geodesics.nblink): given a model and two
83+
- [Geodesics](examples/05_Geodesics.ipynb): given a model and two
8484
images, synthesize a sequence of images that lie on the shortest
8585
("geodesic") path in the model's representation space. This
8686
method investigates how a model represents motion and what changes

docs/index.rst

Lines changed: 40 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ Synthesis methods
8787
that of the reference image. This method investigates what image features the
8888
model disregards entirely.
8989

90-
- Example papers: [Portilla2000]_, [Freeman2011]_
90+
- Example papers: [Portilla2000]_, [Freeman2011]_, [Deza2019]_,
91+
[Feather2019]_, [Wallis2019]_
9192
- `Eigendistortions <tutorials/02_Eigendistortions.nblink>`_: given a model and a
9293
reference image, compute the image perturbation that produces the smallest and
9394
largest changes in the model response space. This method investigates the
@@ -161,30 +162,46 @@ In all cases, please follow our `code of conduct
161162
<https://github.com/LabForComputationalVision/plenoptic/blob/main/CODE_OF_CONDUCT.md>`_.
162163

163164
.. toctree::
164-
:maxdepth: 1
165-
:caption: Contents:
165+
:titlesonly:
166+
:caption: Basic concepts
167+
:glob:
166168

167169
install
168170
conceptual_intro
169171
models
170-
synthesis
171-
tips
172-
reproducibility
173-
api/modules
172+
tutorials/*
174173

175174
.. toctree::
176175
:titlesonly:
177176
:glob:
178-
:caption: Tutorials and examples
177+
:caption: Synthesis method introductions
179178

180-
tutorials/*
179+
tutorials/intro/*
180+
181+
.. toctree::
182+
:titlesonly:
183+
:glob:
184+
:caption: Models and metrics
181185

182-
Indices and tables
183-
==================
186+
tutorials/models/*
184187

185-
* :ref:`genindex`
186-
* :ref:`modindex`
187-
* :ref:`search`
188+
.. toctree::
189+
:titlesonly:
190+
:glob:
191+
:caption: Synthesis method examples
192+
193+
tutorials/applications/*
194+
195+
.. toctree::
196+
:maxdepth: 1
197+
:glob:
198+
:caption: Advanced usage
199+
200+
synthesis
201+
tips
202+
reproducibility
203+
Modules <api/modules>
204+
tutorials/advanced/*
188205

189206
.. [Portilla2000] Portilla, J., & Simoncelli, E. P. (2000). A parametric texture
190207
model based on joint statistics of complex wavelet coefficients.
@@ -194,6 +211,15 @@ Indices and tables
194211
.. [Freeman2011] Freeman, J., & Simoncelli, E. P. (2011). Metamers of the
195212
ventral stream. Nature Neuroscience, 14(9), 1195–1201.
196213
http://www.cns.nyu.edu/pub/eero/freeman10-reprint.pdf
214+
.. [Deza2019] Deza, A., Jonnalagadda, A., & Eckstein, M. P. (2019). Towards
215+
metamerism via foveated style transfer. In , International Conference on
216+
Learning Representations.
217+
.. [Feather2019] Feather, J., Durango, A., Gonzalez, R., & McDermott, J. (2019).
218+
Metamers of neural networks reveal divergence from human perceptual systems.
219+
In NeurIPS (pp. 10078–10089).
220+
.. [Wallis2019] Wallis, T. S., Funke, C. M., Ecker, A. S., Gatys, L. A.,
221+
Wichmann, F. A., & Bethge, M. (2019). Image content is more important than
222+
bouma's law for scene metamers. eLife. http://dx.doi.org/10.7554/elife.42512
197223
.. [Berardino2017] Berardino, A., Laparra, V., J Ball\'e, & Simoncelli, E. P.
198224
(2017). Eigen-distortions of hierarchical representations. In I. Guyon, U.
199225
Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, & R. Garnett,

docs/synthesis.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.. _synthesis-objects:
22

3-
Synthesis objects
4-
*****************
3+
Synthesis object design
4+
***********************
55

66
The following describes how synthesis objects are structured. This is probably
77
most useful if you are creating a new synthesis method that you would like to
@@ -17,7 +17,7 @@ testing), but we want to avoid forcing too much similarity.
1717

1818
In the following description:
1919

20-
* *must* connotes a requirement; any synthesis object not meeting this property
20+
** *must* connotes a requirement; any synthesis object not meeting this property
2121
will not be merged and is not considered "plenoptic-compliant".
2222
* *should* connotes a suggestion; a compelling reason is required if the
2323
property is not met.
@@ -108,7 +108,7 @@ for an example. If possible, this plot should be able to be animated to show
108108
progress over time. See
109109
:func:`plenoptic.synthesize.metamer.plot_synthesis_status` for an example.
110110

111-
See our :doc:`/tutorials/Display` notebook for description and examples of the
111+
See our :doc:`/tutorials/advanced/Display` notebook for description and examples of the
112112
included plotting and display code.
113113

114114
Optimized synthesis

docs/tutorials/01_Linear_approximation_of_nonlinear_model.nblink

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/tutorials/02_Eigendistortions.nblink

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/tutorials/03_Steerable_Pyramid.nblink

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/tutorials/04_Perceptual_distance.nblink

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/tutorials/05_Geodesics.nblink

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)