RRAEsTorch 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. rraestorch-0.1.0/.github/workflows/python-app.yml +41 -0
  2. rraestorch-0.1.0/.gitignore +207 -0
  3. rraestorch-0.1.0/.gitignore copy +207 -0
  4. rraestorch-0.1.0/LICENSE +21 -0
  5. rraestorch-0.1.0/LICENSE copy +21 -0
  6. rraestorch-0.1.0/PKG-INFO +90 -0
  7. rraestorch-0.1.0/README copy.md +69 -0
  8. rraestorch-0.1.0/README.md +69 -0
  9. rraestorch-0.1.0/RRAEsTorch/AE_base/AE_base.py +104 -0
  10. rraestorch-0.1.0/RRAEsTorch/AE_base/__init__.py +1 -0
  11. rraestorch-0.1.0/RRAEsTorch/AE_classes/AE_classes.py +636 -0
  12. rraestorch-0.1.0/RRAEsTorch/AE_classes/__init__.py +1 -0
  13. rraestorch-0.1.0/RRAEsTorch/__init__.py +1 -0
  14. rraestorch-0.1.0/RRAEsTorch/config.py +95 -0
  15. rraestorch-0.1.0/RRAEsTorch/tests/test_AE_classes_CNN.py +76 -0
  16. rraestorch-0.1.0/RRAEsTorch/tests/test_AE_classes_MLP.py +73 -0
  17. rraestorch-0.1.0/RRAEsTorch/tests/test_fitting_CNN.py +109 -0
  18. rraestorch-0.1.0/RRAEsTorch/tests/test_fitting_MLP.py +133 -0
  19. rraestorch-0.1.0/RRAEsTorch/tests/test_mains.py +34 -0
  20. rraestorch-0.1.0/RRAEsTorch/tests/test_save.py +62 -0
  21. rraestorch-0.1.0/RRAEsTorch/tests/test_stable_SVD.py +37 -0
  22. rraestorch-0.1.0/RRAEsTorch/tests/test_wrappers.py +56 -0
  23. rraestorch-0.1.0/RRAEsTorch/trackers/__init__.py +1 -0
  24. rraestorch-0.1.0/RRAEsTorch/trackers/trackers.py +245 -0
  25. rraestorch-0.1.0/RRAEsTorch/training_classes/__init__.py +5 -0
  26. rraestorch-0.1.0/RRAEsTorch/training_classes/training_classes.py +977 -0
  27. rraestorch-0.1.0/RRAEsTorch/utilities/__init__.py +1 -0
  28. rraestorch-0.1.0/RRAEsTorch/utilities/utilities.py +1562 -0
  29. rraestorch-0.1.0/RRAEsTorch/wrappers/__init__.py +1 -0
  30. rraestorch-0.1.0/RRAEsTorch/wrappers/wrappers.py +237 -0
  31. rraestorch-0.1.0/general-MLP.py +65 -0
  32. rraestorch-0.1.0/main-CNN.py +114 -0
  33. rraestorch-0.1.0/main-CNN1D.py +111 -0
  34. rraestorch-0.1.0/main-CNN3D.py +103 -0
  35. rraestorch-0.1.0/main-MLP.py +108 -0
  36. rraestorch-0.1.0/main-adap-CNN.py +109 -0
  37. rraestorch-0.1.0/main-adap-MLP.py +109 -0
  38. rraestorch-0.1.0/main-var-CNN.py +128 -0
  39. rraestorch-0.1.0/main-var-CNN1D.py +130 -0
  40. rraestorch-0.1.0/pyproject.toml +13 -0
  41. rraestorch-0.1.0/setup.cfg +0 -0
@@ -0,0 +1,41 @@
1
+ # This workflow will install Python dependencies, run tests and lint with a single version of Python
2
+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3
+
4
+ name: Python application
5
+
6
+ on:
7
+ push:
8
+ branches: [ "main" ]
9
+ pull_request:
10
+ branches: [ "main" ]
11
+
12
+ permissions:
13
+ contents: read
14
+
15
+ jobs:
16
+ build:
17
+
18
+ runs-on: ubuntu-latest
19
+
20
+ steps:
21
+ - uses: actions/checkout@v4
22
+ - name: Set up Python 3.11
23
+ uses: actions/setup-python@v3
24
+ with:
25
+ python-version: "3.10"
26
+ - name: Install dependencies
27
+ run: |
28
+ python -m pip install --upgrade pip
29
+
30
+ pip install flake8 pytest
31
+ if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
32
+ - name: Lint with flake8
33
+ run: |
34
+ # stop the build if there are Python syntax errors or undefined names
35
+ # flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
36
+ # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
37
+ # flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
38
+ - name: Test with pytest
39
+ run: |
40
+ python -m pip install RRAEsTorch
41
+ pytest .
@@ -0,0 +1,207 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py.cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ #uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ #poetry.lock
109
+ #poetry.toml
110
+
111
+ # pdm
112
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
113
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
114
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
115
+ #pdm.lock
116
+ #pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # pixi
121
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
122
+ #pixi.lock
123
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
124
+ # in the .venv directory. It is recommended not to include this directory in version control.
125
+ .pixi
126
+
127
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
128
+ __pypackages__/
129
+
130
+ # Celery stuff
131
+ celerybeat-schedule
132
+ celerybeat.pid
133
+
134
+ # SageMath parsed files
135
+ *.sage.py
136
+
137
+ # Environments
138
+ .env
139
+ .envrc
140
+ .venv
141
+ env/
142
+ venv/
143
+ ENV/
144
+ env.bak/
145
+ venv.bak/
146
+
147
+ # Spyder project settings
148
+ .spyderproject
149
+ .spyproject
150
+
151
+ # Rope project settings
152
+ .ropeproject
153
+
154
+ # mkdocs documentation
155
+ /site
156
+
157
+ # mypy
158
+ .mypy_cache/
159
+ .dmypy.json
160
+ dmypy.json
161
+
162
+ # Pyre type checker
163
+ .pyre/
164
+
165
+ # pytype static type analyzer
166
+ .pytype/
167
+
168
+ # Cython debug symbols
169
+ cython_debug/
170
+
171
+ # PyCharm
172
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
173
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
174
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
175
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
176
+ #.idea/
177
+
178
+ # Abstra
179
+ # Abstra is an AI-powered process automation framework.
180
+ # Ignore directories containing user credentials, local state, and settings.
181
+ # Learn more at https://abstra.io/docs
182
+ .abstra/
183
+
184
+ # Visual Studio Code
185
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
186
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
187
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
188
+ # you could uncomment the following to ignore the entire vscode folder
189
+ # .vscode/
190
+
191
+ # Ruff stuff:
192
+ .ruff_cache/
193
+
194
+ # PyPI configuration file
195
+ .pypirc
196
+
197
+ # Cursor
198
+ # Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
199
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
200
+ # refer to https://docs.cursor.com/context/ignore-files
201
+ .cursorignore
202
+ .cursorindexingignore
203
+
204
+ # Marimo
205
+ marimo/_static/
206
+ marimo/_lsp/
207
+ __marimo__/
@@ -0,0 +1,207 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py.cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ #uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ #poetry.lock
109
+ #poetry.toml
110
+
111
+ # pdm
112
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
113
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
114
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
115
+ #pdm.lock
116
+ #pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # pixi
121
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
122
+ #pixi.lock
123
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
124
+ # in the .venv directory. It is recommended not to include this directory in version control.
125
+ .pixi
126
+
127
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
128
+ __pypackages__/
129
+
130
+ # Celery stuff
131
+ celerybeat-schedule
132
+ celerybeat.pid
133
+
134
+ # SageMath parsed files
135
+ *.sage.py
136
+
137
+ # Environments
138
+ .env
139
+ .envrc
140
+ .venv
141
+ env/
142
+ venv/
143
+ ENV/
144
+ env.bak/
145
+ venv.bak/
146
+
147
+ # Spyder project settings
148
+ .spyderproject
149
+ .spyproject
150
+
151
+ # Rope project settings
152
+ .ropeproject
153
+
154
+ # mkdocs documentation
155
+ /site
156
+
157
+ # mypy
158
+ .mypy_cache/
159
+ .dmypy.json
160
+ dmypy.json
161
+
162
+ # Pyre type checker
163
+ .pyre/
164
+
165
+ # pytype static type analyzer
166
+ .pytype/
167
+
168
+ # Cython debug symbols
169
+ cython_debug/
170
+
171
+ # PyCharm
172
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
173
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
174
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
175
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
176
+ #.idea/
177
+
178
+ # Abstra
179
+ # Abstra is an AI-powered process automation framework.
180
+ # Ignore directories containing user credentials, local state, and settings.
181
+ # Learn more at https://abstra.io/docs
182
+ .abstra/
183
+
184
+ # Visual Studio Code
185
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
186
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
187
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
188
+ # you could uncomment the following to ignore the entire vscode folder
189
+ # .vscode/
190
+
191
+ # Ruff stuff:
192
+ .ruff_cache/
193
+
194
+ # PyPI configuration file
195
+ .pypirc
196
+
197
+ # Cursor
198
+ # Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
199
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
200
+ # refer to https://docs.cursor.com/context/ignore-files
201
+ .cursorignore
202
+ .cursorindexingignore
203
+
204
+ # Marimo
205
+ marimo/_static/
206
+ marimo/_lsp/
207
+ __marimo__/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Jad Mounayer
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Jad Mounayer
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,90 @@
1
+ Metadata-Version: 2.4
2
+ Name: RRAEsTorch
3
+ Version: 0.1.0
4
+ Summary: A repo for RRAEs in PyTorch.
5
+ Author-email: Jad Mounayer <jad.mounayer@outlook.com>
6
+ License: MIT
7
+ License-File: LICENSE
8
+ License-File: LICENSE copy
9
+ Requires-Python: >=3.10
10
+ Requires-Dist: dill
11
+ Requires-Dist: jaxtyping
12
+ Requires-Dist: matplotlib
13
+ Requires-Dist: numpy
14
+ Requires-Dist: pandas
15
+ Requires-Dist: prettytable
16
+ Requires-Dist: pytest
17
+ Requires-Dist: torch
18
+ Requires-Dist: torchvision
19
+ Requires-Dist: tqdm
20
+ Description-Content-Type: text/markdown
21
+
22
+ # RRAEsTorch
23
+
24
+ A library that offers same functions as RRAEs (originally in JAX) but in PyTorch.
25
+
26
+ The RAEDME is copied from RRAEs in the following:
27
+
28
+ # Welcome
29
+
30
+ This repository allows users to train and manipulate Equinox models easily, specifically, Autoencoders.
31
+
32
+ The library provides trainor classes that allow to train Neural Networks in one line using JAX.
33
+
34
+ It also provides easy ways to do normalization, and vectorization of matrices during training.
35
+
36
+ There are also pre-built Autoencoder models, specifically Rank Reduction Autoencoders (RRAEs).
37
+
38
+ # What are RRAEs?
39
+
40
+ RRAEs or Rank reduction autoencoders are autoencoders include an SVD in the latent space to regularize the bottleneck.
41
+
42
+ This library presents all the required classes for creating customized RRAEs and training them (other architectures such as Vanilla AEs, IRMAEs and LoRAEs are also available).
43
+
44
+ Each script is an example of how to train a different model.
45
+
46
+ To simply train an MLP (from equinox), try [this](general-MLP.py)
47
+
48
+ To train an RRAE on curves (1D) using an MLP, refer to [this file](main-MLP.py)
49
+ To train an RRAE on curves (1D) using an Convolutions, refer to [this file](main-CNN1D.py)
50
+ To train an RRAE on images, refer to [this file](main-CNN.py)
51
+ To train a VRRAE on images, refer to [this file](main-var-CNN.py)
52
+ To train with an adaptive bottleneck size refer to [this](main-adap-MLP.py) and [this] file(main-adap-CNN.py)
53
+
54
+ For examples of post-processing and what RRAE trainors can do, refer to [this file](post_process.py)
55
+
56
+ # General instruction for preparing your own data
57
+
58
+ In RRAEs.utilities, there's a function called get_data that can import many datasets to test.
59
+
60
+ If you want to generate your own dataset, you will have to define the following:
61
+
62
+ x_train: Train input (refer to each script to see the shape)
63
+
64
+ x_test: Test input (refer to each script to see the shape)
65
+
66
+ p_train: None (if you don't have any parameters, otherwise,
67
+ these can be used for interpolation in the latent space)
68
+
69
+ p_test: Same as p_train
70
+
71
+ y_train: = x_train for autoencoders
72
+
73
+ y_test: = x_test for autoencoders
74
+
75
+ pre_func_inp: lambda x:x (if not needed, this is a function to be applied
76
+ on batches if memory is not enough to apply
77
+ over whole dataset)
78
+
79
+ pre_func_out: lambda x:x (same as above but for output)
80
+
81
+ kwargs: {} (any other kwargs you might need)
82
+
83
+ # Installation
84
+
85
+ pip install RRAEsTorch
86
+
87
+ Or to get the newest changes:
88
+
89
+ pip install git+https://github.com/JadM133/RRAEsTorch.git
90
+
@@ -0,0 +1,69 @@
1
+ # RRAEsTorch
2
+
3
+ A library that offers same functions as RRAEs (originally in JAX) but in PyTorch.
4
+
5
+ The RAEDME is copied from RRAEs in the following:
6
+
7
+ # Welcome
8
+
9
+ This repository allows users to train and manipulate Equinox models easily, specifically, Autoencoders.
10
+
11
+ The library provides trainor classes that allow to train Neural Networks in one line using JAX.
12
+
13
+ It also provides easy ways to do normalization, and vectorization of matrices during training.
14
+
15
+ There are also pre-built Autoencoder models, specifically Rank Reduction Autoencoders (RRAEs).
16
+
17
+ # What are RRAEs?
18
+
19
+ RRAEs or Rank reduction autoencoders are autoencoders include an SVD in the latent space to regularize the bottleneck.
20
+
21
+ This library presents all the required classes for creating customized RRAEs and training them (other architectures such as Vanilla AEs, IRMAEs and LoRAEs are also available).
22
+
23
+ Each script is an example of how to train a different model.
24
+
25
+ To simply train an MLP (from equinox), try [this](general-MLP.py)
26
+
27
+ To train an RRAE on curves (1D) using an MLP, refer to [this file](main-MLP.py)
28
+ To train an RRAE on curves (1D) using an Convolutions, refer to [this file](main-CNN1D.py)
29
+ To train an RRAE on images, refer to [this file](main-CNN.py)
30
+ To train a VRRAE on images, refer to [this file](main-var-CNN.py)
31
+ To train with an adaptive bottleneck size refer to [this](main-adap-MLP.py) and [this] file(main-adap-CNN.py)
32
+
33
+ For examples of post-processing and what RRAE trainors can do, refer to [this file](post_process.py)
34
+
35
+ # General instruction for preparing your own data
36
+
37
+ In RRAEs.utilities, there's a function called get_data that can import many datasets to test.
38
+
39
+ If you want to generate your own dataset, you will have to define the following:
40
+
41
+ x_train: Train input (refer to each script to see the shape)
42
+
43
+ x_test: Test input (refer to each script to see the shape)
44
+
45
+ p_train: None (if you don't have any parameters, otherwise,
46
+ these can be used for interpolation in the latent space)
47
+
48
+ p_test: Same as p_train
49
+
50
+ y_train: = x_train for autoencoders
51
+
52
+ y_test: = x_test for autoencoders
53
+
54
+ pre_func_inp: lambda x:x (if not needed, this is a function to be applied
55
+ on batches if memory is not enough to apply
56
+ over whole dataset)
57
+
58
+ pre_func_out: lambda x:x (same as above but for output)
59
+
60
+ kwargs: {} (any other kwargs you might need)
61
+
62
+ # Installation
63
+
64
+ pip install RRAEs
65
+
66
+ Or to get the newest changes:
67
+
68
+ pip install git+https://github.com/JadM133/RRAEs.git
69
+