Skip to content

Commit 39bf22a

Browse files
0.3.1 (#54)
* added CONTRIBUTING.md * updates to docs, tests, and README
1 parent 76b13ca commit 39bf22a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+95
-26915
lines changed

CONTRIBUTING.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Contributing to TRAK
2+
3+
Thanks for your interest in contributing to TRAK! We welcome any sort of
4+
feedback---bug fixes, questions, extensions, etc.
5+
6+
## Extending TRAK
7+
8+
If you have extended TRAK to your own task (e.g., by subclassing
9+
`AbstractModelOutput` or `AbstractGradientComputer`), you can make a pull
10+
request to add your extension to the `trak/contrib` directory. Then, users
11+
can use your extension by importing it from `trak.contrib`. Below, we provide
12+
guidelines for how to structure your extension.
13+
14+
1. Create a new directory in `trak/contrib` for your extension. For example,
15+
if you are extending TRAK to work with diffusion models, you might create
16+
a directory called `diffusion_models`.
17+
18+
2. Create a `README.md` file in your new directory. This file should contain
19+
a description of your extension and a brief example of how to use it.
20+
21+
3. Add all modules that implement your extension.
22+
23+
4. If your extension requires any dependencies that are not already listed in
24+
`setup.py`, add an entry to the `extras_require` dictionary in `setup.py`.
25+
For example, if your extension requires `diffusers`, you might add the
26+
following: `'diffusion_models': ['diffusers']`. Then, users can install your
27+
extension's dependencies with `pip install traker[diffusion_models]`. Do
28+
**not** add the dependencies to the `install_requires` list in `setup.py`.
29+
30+
5. Add any tests in a subdirectory of `tests/contrib` matching the name of your
31+
extension's directory. For example, if your extension is in
32+
`trak/contrib/diffusion_models`, add tests in
33+
`tests/contrib/diffusion_models`. At a minimum, submit an integration test
34+
that demonstrates how to use your extension. Ideally, also submit unit tests
35+
that verify that your extension works as expected.
36+
37+
6. Once you are done, make a pull request to add your extension to TRAK.
38+
39+
## Bugs
40+
41+
If you observe a bug, make an issue with a code snippet that reproduces the
42+
undesired behavior. Feel free to make pull requests that address the bug (see
43+
below).
44+
45+
## Bug fixes
46+
47+
If you observe a bug, and you know how to fix it, feel free to make a pull
48+
request that fixes the bug. Please include a unit test that demonstrates the
49+
bug and verifies that your fix works. Additionally, please run the existing
50+
tests to ensure that your fix does not break any existing functionality. You can
51+
install the test dependencies with `pip install traker[tests]`.
52+
53+
Note that some of the tests are compute-intensive and may require a GPU to run.
54+
So long as your fix does not interact at all with the functionality being tested
55+
by these tests, you can skip them by running `pytest -m "not cuda"`.

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,17 @@ for model_id, checkpoint in enumerate(checkpoints):
6565

6666
scores = traker.finalize_scores(exp_name='test')
6767
```
68-
Check out the [quickstart](https://trak.readthedocs.io/en/latest/quickstart.html) for a complete ready-to-run example notebook.
68+
Then, you can use the compute TRAK scores to analyze your model's behavior. For example, here are the most (positively and negatively) impactful examples for a ResNet18 model trained on ImageNet for three targets from the ImageNet validation set:
69+
![ImageNet Figure](assets/imagenet_figure.jpeg)
6970

71+
Check out the
72+
[quickstart](https://trak.readthedocs.io/en/latest/quickstart.html) for a
73+
complete ready-to-run example notebook. You can also find several end-to-end
74+
examples in the `examples/` directory.
7075

71-
## Examples
72-
You can find several end-to-end examples in the `examples/` directory.
76+
## Contributing
77+
We welcome contributions to this project! Please see our [contributing
78+
guidelines](CONTRIBUTING.md) for more information.
7379

7480
## Citation
7581
If you use this code in your work, please cite using the following BibTeX entry:

assets/imagenet_figure.jpeg

311 KB
Loading

docs/html/.buildinfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: e60030996305630cdf692b57404fa4b3
3+
config: 746b6350ce2007ec99ab115c5cdc39c4
44
tags: 645f666f9bcd5a90fca523b33c5a78b7

docs/html/.doctrees/bert.doctree

1.87 KB
Binary file not shown.

docs/html/.doctrees/clip.doctree

4.26 KB
Binary file not shown.
-992 KB
Binary file not shown.

docs/html/.doctrees/index.doctree

1.58 KB
Binary file not shown.
3.44 KB
Binary file not shown.
7.87 KB
Binary file not shown.

0 commit comments

Comments
 (0)