pytensor-ml 0.0.2__tar.gz → 0.0.4__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 (49) hide show
  1. pytensor_ml-0.0.4/.gitattributes +1 -0
  2. pytensor_ml-0.0.4/.github/workflows/pre-commit.yml +16 -0
  3. pytensor_ml-0.0.4/.github/workflows/release.yml +50 -0
  4. pytensor_ml-0.0.4/.github/workflows/run_tests.yml +86 -0
  5. pytensor_ml-0.0.4/.gitignore +59 -0
  6. pytensor_ml-0.0.4/.pre-commit-config.yaml +65 -0
  7. {pytensor_ml-0.0.2 → pytensor_ml-0.0.4}/PKG-INFO +24 -10
  8. pytensor_ml-0.0.4/conda_envs/pytensor_ml-gpu_jax.yml +43 -0
  9. pytensor_ml-0.0.4/conda_envs/pytensor_ml.yml +30 -0
  10. pytensor_ml-0.0.4/examples/mnist_feed_forward.ipynb +359 -0
  11. {pytensor_ml-0.0.2 → pytensor_ml-0.0.4}/pyproject.toml +27 -17
  12. {pytensor_ml-0.0.2 → pytensor_ml-0.0.4}/pytensor_ml/__init__.py +2 -4
  13. pytensor_ml-0.0.4/pytensor_ml/_version.py +24 -0
  14. {pytensor_ml-0.0.2 → pytensor_ml-0.0.4}/pytensor_ml/activations.py +7 -0
  15. pytensor_ml-0.0.4/pytensor_ml/layers.py +238 -0
  16. pytensor_ml-0.0.4/pytensor_ml/model.py +109 -0
  17. pytensor_ml-0.0.4/pytensor_ml/optimizers.py +365 -0
  18. pytensor_ml-0.0.4/pytensor_ml/params.py +226 -0
  19. {pytensor_ml-0.0.2 → pytensor_ml-0.0.4}/pytensor_ml/pytensorf.py +23 -3
  20. pytensor_ml-0.0.4/pytensor_ml/rewriting/layers.py +85 -0
  21. pytensor_ml-0.0.4/pytensor_ml/state.py +303 -0
  22. pytensor_ml-0.0.4/tests/__init__.py +0 -0
  23. pytensor_ml-0.0.4/tests/conftest.py +43 -0
  24. pytensor_ml-0.0.4/tests/rewriting/__init__.py +0 -0
  25. pytensor_ml-0.0.4/tests/rewriting/test_layers.py +62 -0
  26. pytensor_ml-0.0.4/tests/test_layers.py +182 -0
  27. pytensor_ml-0.0.4/tests/test_loss.py +61 -0
  28. pytensor_ml-0.0.4/tests/test_model.py +101 -0
  29. pytensor_ml-0.0.4/tests/test_optimizers.py +172 -0
  30. pytensor_ml-0.0.4/tests/test_params.py +107 -0
  31. pytensor_ml-0.0.4/tests/test_pytensorf.py +17 -0
  32. pytensor_ml-0.0.4/tests/test_state.py +138 -0
  33. pytensor_ml-0.0.2/pytensor_ml/_version.py +0 -21
  34. pytensor_ml-0.0.2/pytensor_ml/layers.py +0 -103
  35. pytensor_ml-0.0.2/pytensor_ml/model.py +0 -108
  36. pytensor_ml-0.0.2/pytensor_ml/optimizers.py +0 -234
  37. pytensor_ml-0.0.2/pytensor_ml/rewriting/layers.py +0 -37
  38. pytensor_ml-0.0.2/pytensor_ml.egg-info/PKG-INFO +0 -223
  39. pytensor_ml-0.0.2/pytensor_ml.egg-info/SOURCES.txt +0 -20
  40. pytensor_ml-0.0.2/pytensor_ml.egg-info/dependency_links.txt +0 -1
  41. pytensor_ml-0.0.2/pytensor_ml.egg-info/requires.txt +0 -10
  42. pytensor_ml-0.0.2/pytensor_ml.egg-info/top_level.txt +0 -1
  43. pytensor_ml-0.0.2/setup.cfg +0 -4
  44. pytensor_ml-0.0.2/setup.py +0 -19
  45. {pytensor_ml-0.0.2 → pytensor_ml-0.0.4}/LICENSE +0 -0
  46. {pytensor_ml-0.0.2 → pytensor_ml-0.0.4}/README.md +0 -0
  47. {pytensor_ml-0.0.2 → pytensor_ml-0.0.4}/pytensor_ml/loss.py +0 -0
  48. {pytensor_ml-0.0.2 → pytensor_ml-0.0.4}/pytensor_ml/rewriting/__init__.py +0 -0
  49. {pytensor_ml-0.0.2 → pytensor_ml-0.0.4}/pytensor_ml/util.py +0 -0
@@ -0,0 +1 @@
1
+ pytensor_ml/_version.py export-subst
@@ -0,0 +1,16 @@
1
+ name: pre-commit
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches: [main]
7
+
8
+ jobs:
9
+ pre-commit:
10
+ runs-on: ubuntu-latest
11
+ env:
12
+ SKIP: no-commit-to-branch
13
+ steps:
14
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
15
+ - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
16
+ - uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
@@ -0,0 +1,50 @@
1
+ name: release-pipeline
2
+
3
+ permissions: {}
4
+
5
+ on:
6
+ push:
7
+ branches:
8
+ - main
9
+ release:
10
+ types:
11
+ - published
12
+
13
+ jobs:
14
+ build-package:
15
+ runs-on: ubuntu-latest
16
+ permissions:
17
+ # write attestations and id-token are necessary for attest-build-provenance-github
18
+ attestations: write
19
+ id-token: write
20
+ steps:
21
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
22
+ with:
23
+ # hatch-vcs derives the version from git tags, so the full history is required.
24
+ fetch-depth: 0
25
+ persist-credentials: false
26
+ - uses: hynek/build-and-inspect-python-package@d44ca7d91762de7a7d5436ddae667c6da6d1c3df # v2.18.0
27
+ with:
28
+ # Prove that the packages were built in the context of this workflow.
29
+ attest-build-provenance-github: true
30
+
31
+ publish-package:
32
+ # Don't publish from forks
33
+ if: github.repository_owner == 'jessegrabowski' && github.event_name == 'release' && github.event.action == 'published'
34
+ # Use the `release` GitHub environment to protect the Trusted Publishing (OIDC)
35
+ # workflow by requiring signoff from a maintainer.
36
+ environment: release
37
+ needs: build-package
38
+ runs-on: ubuntu-latest
39
+ permissions:
40
+ # write id-token is necessary for trusted publishing (OIDC)
41
+ id-token: write
42
+ steps:
43
+ - name: Download Distribution Artifacts
44
+ uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
45
+ with:
46
+ # The build-and-inspect-python-package action invokes upload-artifact.
47
+ name: Packages
48
+ path: dist
49
+ - name: Publish Package to PyPI
50
+ uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
@@ -0,0 +1,86 @@
1
+ name: run_tests
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches: [main]
7
+
8
+ # Cancels all previous workflow runs for pull requests that have not completed.
9
+ concurrency:
10
+ # The concurrency group contains the workflow name and the branch name for pull requests
11
+ # or the commit hash for any other events.
12
+ group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
13
+ cancel-in-progress: true
14
+
15
+ jobs:
16
+ unittest:
17
+ strategy:
18
+ fail-fast: false
19
+ matrix:
20
+ os: [ubuntu-latest, windows-latest]
21
+ python-version: ["3.12"]
22
+ test-subset:
23
+ - |
24
+ tests/
25
+
26
+ runs-on: ${{ matrix.os }}
27
+
28
+ env:
29
+ TEST_SUBSET: ${{ matrix.test-subset }}
30
+
31
+ defaults:
32
+ run:
33
+ shell: bash -l {0}
34
+
35
+ steps:
36
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
37
+ - uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
38
+ env:
39
+ CACHE_NUMBER: 0
40
+ with:
41
+ path: ~/conda_pkgs_dir
42
+ key: ${{ runner.os }}-py${{matrix.python-version}}-conda-${{ env.CACHE_NUMBER }}-${{
43
+ hashFiles('conda_envs/pytensor_ml.yml') }}
44
+ - name: Cache multiple paths
45
+ uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
46
+ env:
47
+ # Increase this value to reset cache if pyproject.toml has not changed
48
+ CACHE_NUMBER: 0
49
+ with:
50
+ path: |
51
+ ~/.cache/pip
52
+ $RUNNER_TOOL_CACHE/Python/*
53
+ ~\AppData\Local\pip\Cache
54
+ key: ${{ runner.os }}-build-${{ matrix.python-version }}-${{ env.CACHE_NUMBER }}-${{
55
+ hashFiles('pyproject.toml') }}
56
+ - uses: conda-incubator/setup-miniconda@8ee1f361103df19b6f8c8655fd3967a8ecb162d5 # v4.0.1
57
+ with:
58
+ miniforge-variant: Miniforge3
59
+ miniforge-version: latest
60
+ mamba-version: "*"
61
+ activate-environment: pytensor_ml
62
+ channel-priority: strict
63
+ environment-file: conda_envs/pytensor_ml.yml
64
+ python-version: 3.12
65
+ use-mamba: true
66
+
67
+ # IMPORTANT: This may break caching of conda packages! See https://github.com/conda-incubator/setup-miniconda/issues/267
68
+ use-only-tar-bz2: false
69
+
70
+ - name: Install current branch
71
+ run: |
72
+ conda activate pytensor_ml
73
+ pip install -e .
74
+ python --version
75
+
76
+ - name: Run tests
77
+ run: |
78
+ python -m pytest -vv --cov=pytensor_ml --cov-report=xml --no-cov-on-fail --cov-report term $TEST_SUBSET
79
+ - name: Upload coverage to Codecov
80
+ uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1
81
+ with:
82
+ token: ${{ secrets.CODECOV_TOKEN }} # use token for more robust uploads
83
+ env_vars: TEST_SUBSET
84
+ name: ${{ matrix.os }}
85
+ fail_ci_if_error: false
86
+ verbose: true
@@ -0,0 +1,59 @@
1
+ *.pkl
2
+ _build
3
+ __pycache__
4
+ .coverage
5
+ *.linkinfo
6
+ *.o
7
+ *.c
8
+ *.orig
9
+ *.pyc
10
+ *.pyo
11
+ *.so
12
+ *.sw?
13
+ *~
14
+ *.aux
15
+ *.log
16
+ *.nav
17
+ *.out
18
+ *.snm
19
+ *.toc
20
+ *.vrb
21
+ *.nbc
22
+ *.nbi
23
+ .noseids
24
+ *.DS_Store
25
+ *.bak
26
+ *.egg-info/
27
+ \#*\#
28
+ build
29
+ compiled/*.cpp
30
+ core.*
31
+ cutils_ext.cpp
32
+ dist
33
+ doc/.build/
34
+ doc/indexes/oplist.txt
35
+ doc/indexes/typelist.txt
36
+ html
37
+ pdf
38
+ setuptools-*.egg
39
+ pytensor/generated_version.py
40
+ pytensor/generated_version.py.out
41
+ distribute-*.egg
42
+ distribute-*.tar.gz
43
+ PyTensor.suo
44
+ .ipynb_checkpoints
45
+ .pydevproject
46
+ .ropeproject
47
+ core
48
+ .idea
49
+ .vs
50
+ .mypy_cache/
51
+ /htmlcov/
52
+ pytensor_ml/_version.py
53
+
54
+ pytensor-venv/
55
+ /notebooks/Sandbox*
56
+ .vscode/
57
+ testing-report.html
58
+ coverage.xml
59
+ .coverage.*
@@ -0,0 +1,65 @@
1
+ repos:
2
+ - repo: https://github.com/pre-commit/pre-commit-hooks
3
+ rev: v6.0.0
4
+ hooks:
5
+ - id: check-merge-conflict
6
+ - id: check-toml
7
+ - id: check-yaml
8
+ - id: debug-statements
9
+ - id: end-of-file-fixer
10
+ - id: no-commit-to-branch
11
+ args: [--branch, main]
12
+ - id: trailing-whitespace
13
+
14
+ - repo: https://github.com/astral-sh/ruff-pre-commit
15
+ rev: v0.15.15
16
+ hooks:
17
+ - id: ruff
18
+ args: [ --fix, --exit-non-zero-on-fix ]
19
+ - id: ruff-format
20
+ types_or: [ python, pyi, jupyter ]
21
+
22
+ - repo: https://github.com/MarcoGorelli/madforhooks
23
+ rev: 0.4.1
24
+ hooks:
25
+ - id: no-print-statements
26
+ types: [python]
27
+ exclude: |
28
+ (?x)^
29
+ |pytensor_ml/_version.py
30
+ - id: check-execution-order
31
+ args: [--strict]
32
+
33
+ - repo: local
34
+ hooks:
35
+ - id: notebook_name
36
+ entry: '\(notebook_name\)='
37
+ language: pygrep
38
+ minimum_pre_commit_version: 2.8.0
39
+ name: Check notebooks do not use literally notebook_name as target
40
+ types: [jupyter]
41
+
42
+ - id: no-references-as-links
43
+ name: Check no references that should be sphinx cross-references are urls
44
+ description: >-
45
+ 'A quick check to prevent urls pointing to pymc docs or other sphinx built docs like arviz, numpy, scipy...'
46
+ files: ^examples/.+\.ipynb$
47
+ exclude: >
48
+ (?x)(index.md|
49
+ 404.md|
50
+ conf.py)
51
+ entry: >
52
+ (?x)(arviz-devs.github.io|
53
+ pymc-experimental.readthedocs.io|
54
+ docs.pymc.io|
55
+ numpy.org/doc|
56
+ pymc-examples.readthedocs.io|
57
+ docs.python.org|
58
+ xarray.pydata.org|
59
+ python.arviz.org|
60
+ pytensor.readthedocs.io|
61
+ docs.xarray.dev|
62
+ www.pymc.io|
63
+ docs.scipy.org/doc)
64
+ language: pygrep
65
+ types_or: [markdown, rst, jupyter]
@@ -1,7 +1,10 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: pytensor_ml
3
- Version: 0.0.2
3
+ Version: 0.0.4
4
4
  Summary: A(nother) deep learning library, built on top of Pytensor
5
+ Project-URL: Homepage, https://github.com/jessegrabowski/pytensor_ml
6
+ Project-URL: Source, https://github.com/jessegrabowski/pytensor_ml
7
+ Project-URL: Tracker, https://github.com/jessegrabowski/pytensor_ml/issues
5
8
  Author: Ricardo Vieira
6
9
  Author-email: Jesse Grabowski <jessegrabowski@gmail.com>
7
10
  License: Apache License
@@ -205,19 +208,30 @@ License: Apache License
205
208
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
206
209
  See the License for the specific language governing permissions and
207
210
  limitations under the License.
208
-
209
- Keywords: neural network,deep learning,autograd,gradient descent,pymc
211
+ License-File: LICENSE
212
+ Keywords: autograd,deep learning,gradient descent,neural network,pymc
210
213
  Classifier: Development Status :: 2 - Pre-Alpha
211
214
  Classifier: Intended Audience :: Science/Research
212
- Classifier: Programming Language :: Python
213
- Classifier: Topic :: Scientific/Engineering
215
+ Classifier: Operating System :: MacOS
214
216
  Classifier: Operating System :: Microsoft :: Windows
215
217
  Classifier: Operating System :: POSIX
216
218
  Classifier: Operating System :: Unix
217
- Classifier: Operating System :: MacOS
219
+ Classifier: Programming Language :: Python
218
220
  Classifier: Programming Language :: Python :: 3
219
- Classifier: Programming Language :: Python :: 3.10
220
- Classifier: Programming Language :: Python :: 3.11
221
221
  Classifier: Programming Language :: Python :: 3.12
222
+ Classifier: Programming Language :: Python :: 3.13
223
+ Classifier: Programming Language :: Python :: 3.14
224
+ Classifier: Topic :: Scientific/Engineering
225
+ Requires-Python: >=3.12
226
+ Requires-Dist: numpy
227
+ Requires-Dist: pymc<7.0.0,>=6.0.0
228
+ Requires-Dist: pytensor<4.0.0,>=3.0.0
222
229
  Provides-Extra: dev
223
- License-File: LICENSE
230
+ Requires-Dist: pre-commit; extra == 'dev'
231
+ Requires-Dist: pytest; extra == 'dev'
232
+ Requires-Dist: pytest-cov; extra == 'dev'
233
+ Requires-Dist: scikit-learn; extra == 'dev'
234
+ Description-Content-Type: text/markdown
235
+
236
+ # pytensor_ml
237
+ Neural network package built on Pytensor
@@ -0,0 +1,43 @@
1
+ name: pytensor_ml
2
+ channels:
3
+ - conda-forge
4
+ - nvidia
5
+ - nodefaults
6
+
7
+ dependencies:
8
+ - python>=3.12
9
+ - pytensor>=3.0.0,<4.0.0
10
+ - pymc>=6.0.0,<7.0.0
11
+ - numpy
12
+ - scikit-learn
13
+
14
+ # GPU Stuff
15
+ - jax
16
+ - numpyro
17
+ - blackjax
18
+ - jaxlib=*=*cuda*
19
+ - cuda-nvcc
20
+
21
+ # For testing
22
+ - coveralls
23
+ - diff-cover
24
+ - pytest
25
+ - pytest-cov
26
+ - pytest-xdist
27
+ - pytest-benchmark
28
+ - pytest-mock
29
+
30
+ # For building docs
31
+ - sphinx
32
+ - sphinx_rtd_theme
33
+ - pygments
34
+ - pydot
35
+ - ipython
36
+
37
+ # code style
38
+ - ruff
39
+
40
+ # developer tools
41
+ - pre-commit
42
+ - packaging
43
+ - typing_extensions
@@ -0,0 +1,30 @@
1
+ name: pytensor_ml
2
+ channels:
3
+ - conda-forge
4
+ - nodefaults
5
+
6
+ dependencies:
7
+ - python>=3.12
8
+ - pytensor>=3.0.0,<4.0.0
9
+ - pymc>=6.0.0,<7.0.0
10
+ - numpy
11
+ - scikit-learn
12
+
13
+ # For testing
14
+ - coveralls
15
+ - diff-cover
16
+ - pytest
17
+ - pytest-cov
18
+ - pytest-xdist
19
+ - pytest-benchmark
20
+ - pytest-mock
21
+
22
+ # For building docs
23
+ - sphinx
24
+ - sphinx_rtd_theme
25
+ - pygments
26
+ - pydot
27
+ - ipython
28
+
29
+ # developer tools
30
+ - pre-commit