Skip to content

Commit

Permalink
Konsti recorders (#6)
Browse files Browse the repository at this point in the history
* Include correct license in pyproject

* Update gitignore to ignore specific vscode settings.

* Include header in existing files.

* Create BaseMeasurement Class

* Deactivate Black on PRs

* - Write BaseMeasurement class work
Create a test for - BaseMeasurement

* remove dummy test

* add temporal test notebook

* Start writing measurements

* Start writing matrix utils and according tests

* remove file for entropy measurement

* run black

* Fix signs in testing eigenspace computation

* try fixing numpy installation

* Fix missing numpy installation in developer mode

* fix base_measurement test

* Write matrix utils

* Implement analysis utils and tests

* remove unnessecary inputs from tests

* make kwargs of shannon and von neuman entropy similar

* write default measurements

* run isort

* Write init for measurements

* Introduce neural states as a state representation of an NN in form of a dict of np.arrays.

* Start writing measurements example notebook.

* run black and isort

* remove unnecessary import

* declare type hint of neural state

* remove unused imports

* Add test for neural state keys

* Create base recorder module

* Add ntk to measurements

* Write test for recorder base class

* remove unused imports

* Write
- neural state
- neural state creator

* fix pytest file search

* Create Flax MNIST

* Fix import issues

* Write placeholder data storage
Write executable example

* remove print from tests

* make mnist example run on full data

* Remove logging of clipping in eigenvalue calculation

* optimize data storage and loading

* Make the neural state creator be able to take a data set and handle the format of the data set.

* Create ToDos to mark future changes in the recorder class.

* Start writing a data set recorder which is going to be used for ZnNL

* Change error message for keyerror in NSC

* Include python 3.10 in supported versions

* - Make reading neural state keys a method
- Introduce boolean overwrite kwarg

* rename function input to loss and accuracy

* Adapt docstring of BaseRecorder

* Adapt docstring of BaseRecorder

* remove unused parts from test_base_measurement

* remove print statement from test_base_measurement

* Add shape check to BaseMeasurement class

* Add shape checking to all ntk measurements

* Make base recorder count internally

* make store method public

* - Use tempfile for recorder testing
- write gather method for base recorder

* correct the overwrite method

* Add option to the recorder to store in any case, ignoring the chunk size

* use the gather method to store data

* Include NTK measurement in imports

* Remove
- Neural State
- Neural State Creator
- Data Set Recorder
From the package.
These things have been implemented in ZnNL

* Adapt measurements notebook example

* write loss derivative measurement.

* write loss derivative measurement.

* Remove the `public` kwarg from measurements

* remove public kwarg from loss derivative

* inlcude loss derivative in init

* Include hdf5 data storage [unfinished]

* Finish testing for recorders using h5py data storage

* Remove unused clear database fn

* add h5py to deve requirements

* remove todos from docstrings

* Save recorder names properly

* Update test_matrix_utils.py

Removed print statement

* Re-name analysis utils test module

* rename grammian to gramian

* Remove Neural State since unused

* Fix header of init

---------

Co-authored-by: knikolaou <[email protected]>
Co-authored-by: Samuel Tovey <[email protected]>
  • Loading branch information
3 people authored Jun 10, 2024
1 parent e5b4af7 commit 4290300
Show file tree
Hide file tree
Showing 18 changed files with 1,468 additions and 364 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.11"]
python-version: ["3.11", "3.10"]

steps:
- uses: actions/checkout@v4
Expand Down
69 changes: 0 additions & 69 deletions CI/unit_tests/neural_state/test_neural_state.py

This file was deleted.

65 changes: 0 additions & 65 deletions CI/unit_tests/neural_state/test_neural_state_creator.py

This file was deleted.

Loading

0 comments on commit 4290300

Please sign in to comment.