TRAIS-Lab / dattri

`dattri` is a PyTorch library for developing, benchmarking, and deploying efficient data attribution algorithms.
https://trais-lab.github.io/dattri/
MIT License
30 stars 9 forks source link

Initiate projector code and test file #12

Closed tingwl0122 closed 7 months ago

tingwl0122 commented 7 months ago
tingwl0122 commented 7 months ago

Should PLR0913 (Too many arguments in function definition, 6>5) be too strict? I feel like there should be some functions implemented in the future with many arguments but not easy to be segmented.

tingwl0122 commented 7 months ago

(ANN101 Missing type annotation for self in method) seems to be too strict. I saw some discussions in the Ruff GitHub repo that this is removed in their 0.2.0 version. I don't know whether we need to keep this.

jiaqima commented 7 months ago

Feel free to suppress these two in pyproject.toml.

tingwl0122 commented 7 months ago

Hi @jiaqima @TheaperDeng The current version follows the content covered in yesterday's meeting (vectorized and three projectors).

I will work on some additional functions (also inherited from TRAK) and a wrapper function to automatically select the right projector for the users as well as the test script (test_proj.py).

jiaqima commented 7 months ago

@tingwl0122 To keep the PR short, I think we can merge this PR first if you add a minimal test for each function and class.

tingwl0122 commented 7 months ago

Sure, I will work on the test file first.

TheaperDeng commented 7 months ago

Sorry there is a small conflict on pyproject.toml, should be easy to fix.

tingwl0122 commented 7 months ago

Sorry there is a small conflict on pyproject.toml, should be easy to fix.

@TheaperDeng , I will disable ruff [PLR0913] in the new pyproject.toml. Could you help resolve the current ruff error?

tingwl0122 commented 7 months ago

Sorry there is a small conflict on pyproject.toml, should be easy to fix.

@TheaperDeng , I will disable ruff [PLR0913] in the new pyproject.toml. Could you help resolve the current ruff error?

Since just a super simple fix (removing # noqa: PLR0913 in retrain.py), I will just include that here also.

TheaperDeng commented 7 months ago

merge this PR since the remaining issues could be fixed by next PRs and does not affect the main functionality.