pytensor-ml 0.2.1__tar.gz → 0.3.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 (242) hide show
  1. pytensor_ml-0.3.0/.github/workflows/rtd-preview.yml +30 -0
  2. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/.github/workflows/run_tests.yml +11 -3
  3. pytensor_ml-0.3.0/.readthedocs.yaml +24 -0
  4. pytensor_ml-0.3.0/PKG-INFO +140 -0
  5. pytensor_ml-0.3.0/README.md +97 -0
  6. pytensor_ml-0.3.0/conda_envs/environment-docs.yml +35 -0
  7. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/conda_envs/pytensor_ml-gpu_jax.yml +1 -1
  8. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/conda_envs/pytensor_ml.yml +2 -8
  9. pytensor_ml-0.3.0/docs/.gitignore +16 -0
  10. pytensor_ml-0.3.0/docs/Makefile +34 -0
  11. pytensor_ml-0.3.0/docs/make.bat +29 -0
  12. pytensor_ml-0.3.0/docs/source/_templates/autosummary/class.rst +34 -0
  13. pytensor_ml-0.3.0/docs/source/api/activations.rst +18 -0
  14. pytensor_ml-0.3.0/docs/source/api/layers.rst +104 -0
  15. pytensor_ml-0.3.0/docs/source/api/loss.rst +12 -0
  16. pytensor_ml-0.3.0/docs/source/api/model.rst +9 -0
  17. pytensor_ml-0.3.0/docs/source/api/models.rst +34 -0
  18. pytensor_ml-0.3.0/docs/source/api/optim.rst +150 -0
  19. pytensor_ml-0.3.0/docs/source/api/pytensorf.rst +33 -0
  20. pytensor_ml-0.3.0/docs/source/api/serialization.rst +24 -0
  21. pytensor_ml-0.3.0/docs/source/api/state.rst +39 -0
  22. pytensor_ml-0.3.0/docs/source/api/util.rst +9 -0
  23. pytensor_ml-0.3.0/docs/source/api.rst +19 -0
  24. pytensor_ml-0.3.0/docs/source/conf.py +176 -0
  25. pytensor_ml-0.3.0/docs/source/dev/contributing.rst +91 -0
  26. pytensor_ml-0.3.0/docs/source/dev/docs.rst +87 -0
  27. pytensor_ml-0.3.0/docs/source/dev/index.rst +9 -0
  28. pytensor_ml-0.3.0/docs/source/dev/style_guide.rst +246 -0
  29. pytensor_ml-0.3.0/docs/source/index.rst +88 -0
  30. pytensor_ml-0.3.0/docs/source/install.rst +87 -0
  31. pytensor_ml-0.3.0/docs/source/references.bib +73 -0
  32. pytensor_ml-0.3.0/docs/source/sharp_edges.rst +289 -0
  33. pytensor_ml-0.3.0/docs/sphinxext/generate_gallery.py +318 -0
  34. pytensor_ml-0.3.0/examples/gallery/mnist_feed_forward.ipynb +758 -0
  35. pytensor_ml-0.3.0/pixi.lock +10749 -0
  36. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/pyproject.toml +58 -2
  37. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/pytensor_ml/__init__.py +1 -0
  38. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/pytensor_ml/_version.py +2 -2
  39. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/pytensor_ml/activations.py +183 -3
  40. pytensor_ml-0.3.0/pytensor_ml/base.py +160 -0
  41. pytensor_ml-0.3.0/pytensor_ml/checkpoint.py +350 -0
  42. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/pytensor_ml/dispatch/jax/__init__.py +1 -0
  43. pytensor_ml-0.3.0/pytensor_ml/dispatch/jax/attention.py +36 -0
  44. pytensor_ml-0.3.0/pytensor_ml/dispatch/jax/line_search.py +41 -0
  45. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/pytensor_ml/dispatch/mlx/__init__.py +2 -0
  46. pytensor_ml-0.3.0/pytensor_ml/dispatch/mlx/lbfgs.py +51 -0
  47. pytensor_ml-0.3.0/pytensor_ml/dispatch/mlx/line_search.py +261 -0
  48. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/pytensor_ml/json_serialize.py +1 -1
  49. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/pytensor_ml/layers/__init__.py +10 -0
  50. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/pytensor_ml/layers/attention.py +164 -30
  51. pytensor_ml-0.3.0/pytensor_ml/layers/combinators.py +171 -0
  52. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/pytensor_ml/layers/conv.py +374 -88
  53. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/pytensor_ml/layers/dropout.py +22 -3
  54. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/pytensor_ml/layers/embedding.py +17 -4
  55. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/pytensor_ml/layers/linear.py +23 -4
  56. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/pytensor_ml/layers/norm.py +377 -22
  57. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/pytensor_ml/layers/padding.py +139 -4
  58. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/pytensor_ml/layers/recurrent.py +209 -42
  59. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/pytensor_ml/layers/transformer.py +75 -15
  60. pytensor_ml-0.3.0/pytensor_ml/loss.py +246 -0
  61. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/pytensor_ml/model.py +70 -15
  62. pytensor_ml-0.3.0/pytensor_ml/models/__init__.py +24 -0
  63. pytensor_ml-0.3.0/pytensor_ml/models/architectures/__init__.py +3 -0
  64. pytensor_ml-0.3.0/pytensor_ml/models/architectures/clip.py +190 -0
  65. pytensor_ml-0.3.0/pytensor_ml/models/architectures/gpt2.py +127 -0
  66. pytensor_ml-0.3.0/pytensor_ml/models/architectures/vae.py +343 -0
  67. pytensor_ml-0.3.0/pytensor_ml/models/blocks/__init__.py +4 -0
  68. pytensor_ml-0.3.0/pytensor_ml/models/blocks/attention.py +78 -0
  69. pytensor_ml-0.3.0/pytensor_ml/models/blocks/resnet.py +173 -0
  70. pytensor_ml-0.3.0/pytensor_ml/models/loading/__init__.py +17 -0
  71. pytensor_ml-0.3.0/pytensor_ml/models/loading/binding.py +28 -0
  72. pytensor_ml-0.3.0/pytensor_ml/models/loading/keys.py +224 -0
  73. pytensor_ml-0.3.0/pytensor_ml/models/loading/registry.py +120 -0
  74. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/pytensor_ml/optim/__init__.py +19 -2
  75. pytensor_ml-0.3.0/pytensor_ml/optim/alias.py +562 -0
  76. pytensor_ml-0.3.0/pytensor_ml/optim/base.py +677 -0
  77. pytensor_ml-0.3.0/pytensor_ml/optim/checks.py +66 -0
  78. pytensor_ml-0.3.0/pytensor_ml/optim/clipping.py +153 -0
  79. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/pytensor_ml/optim/guards.py +173 -39
  80. pytensor_ml-0.3.0/pytensor_ml/optim/lbfgs.py +179 -0
  81. pytensor_ml-0.3.0/pytensor_ml/optim/line_search.py +586 -0
  82. pytensor_ml-0.3.0/pytensor_ml/optim/policy.py +201 -0
  83. pytensor_ml-0.3.0/pytensor_ml/optim/rules.py +1133 -0
  84. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/pytensor_ml/optim/schedules.py +247 -49
  85. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/pytensor_ml/optim/train.py +55 -19
  86. pytensor_ml-0.3.0/pytensor_ml/optim/transform.py +278 -0
  87. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/pytensor_ml/params.py +123 -8
  88. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/pytensor_ml/pretrained.py +183 -19
  89. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/pytensor_ml/pytensorf/__init__.py +2 -0
  90. pytensor_ml-0.3.0/pytensor_ml/pytensorf/collect.py +476 -0
  91. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/pytensor_ml/pytensorf/compile.py +90 -17
  92. pytensor_ml-0.3.0/pytensor_ml/pytensorf/rewrite.py +151 -0
  93. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/pytensor_ml/pytensorf/rng.py +55 -8
  94. pytensor_ml-0.3.0/pytensor_ml/rewriting/layers.py +216 -0
  95. pytensor_ml-0.3.0/pytensor_ml/rewriting/scan.py +376 -0
  96. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/pytensor_ml/state.py +274 -5
  97. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/pytensor_ml/util.py +17 -0
  98. pytensor_ml-0.3.0/tests/conftest.py +153 -0
  99. pytensor_ml-0.3.0/tests/data/attention_block_2d.npz +0 -0
  100. pytensor_ml-0.3.0/tests/data/generate_reference_checkpoints.py +141 -0
  101. pytensor_ml-0.3.0/tests/data/generate_reference_layers.py +98 -0
  102. pytensor_ml-0.3.0/tests/data/resnet_block_2d.npz +0 -0
  103. pytensor_ml-0.3.0/tests/data/sdxl_vae.npz +0 -0
  104. pytensor_ml-0.3.0/tests/data/tiny_clip/config.json +23 -0
  105. pytensor_ml-0.3.0/tests/data/tiny_clip/expected_outputs.npz +0 -0
  106. pytensor_ml-0.3.0/tests/data/tiny_clip/model.safetensors +0 -0
  107. pytensor_ml-0.3.0/tests/data/tiny_clip_with_projection/config.json +23 -0
  108. pytensor_ml-0.3.0/tests/data/tiny_clip_with_projection/expected_outputs.npz +0 -0
  109. pytensor_ml-0.3.0/tests/data/tiny_clip_with_projection/model.safetensors +0 -0
  110. pytensor_ml-0.3.0/tests/data/tiny_gpt2/config.json +34 -0
  111. pytensor_ml-0.3.0/tests/data/tiny_gpt2/expected_outputs.npz +0 -0
  112. pytensor_ml-0.3.0/tests/data/tiny_gpt2/generation_config.json +9 -0
  113. pytensor_ml-0.3.0/tests/data/tiny_gpt2/model.safetensors +0 -0
  114. pytensor_ml-0.3.0/tests/data/tiny_vae/config.json +31 -0
  115. pytensor_ml-0.3.0/tests/data/tiny_vae/diffusion_pytorch_model.safetensors +0 -0
  116. pytensor_ml-0.3.0/tests/data/tiny_vae/expected_outputs.npz +0 -0
  117. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/tests/dispatch/jax/test_attention.py +15 -0
  118. pytensor_ml-0.3.0/tests/dispatch/jax/test_line_search.py +96 -0
  119. pytensor_ml-0.3.0/tests/dispatch/mlx/test_lbfgs.py +137 -0
  120. pytensor_ml-0.3.0/tests/dispatch/mlx/test_line_search.py +135 -0
  121. pytensor_ml-0.3.0/tests/dispatch/mlx/test_norm.py +33 -0
  122. pytensor_ml-0.3.0/tests/models/architectures/__init__.py +0 -0
  123. pytensor_ml-0.3.0/tests/models/architectures/test_clip.py +189 -0
  124. pytensor_ml-0.3.0/tests/models/architectures/test_gpt2.py +121 -0
  125. pytensor_ml-0.3.0/tests/models/architectures/test_vae.py +119 -0
  126. pytensor_ml-0.3.0/tests/models/blocks/__init__.py +0 -0
  127. pytensor_ml-0.3.0/tests/models/blocks/test_attention.py +54 -0
  128. pytensor_ml-0.3.0/tests/models/blocks/test_resnet.py +117 -0
  129. pytensor_ml-0.3.0/tests/models/loading/__init__.py +0 -0
  130. pytensor_ml-0.3.0/tests/models/loading/test_binding.py +11 -0
  131. pytensor_ml-0.3.0/tests/models/loading/test_keys.py +197 -0
  132. pytensor_ml-0.3.0/tests/models/loading/test_registry.py +72 -0
  133. pytensor_ml-0.3.0/tests/optim/__init__.py +0 -0
  134. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/tests/optim/conftest.py +3 -1
  135. pytensor_ml-0.3.0/tests/optim/lbfgs_reference.py +34 -0
  136. pytensor_ml-0.3.0/tests/optim/test_clipping.py +126 -0
  137. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/tests/optim/test_composition.py +87 -4
  138. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/tests/optim/test_guards.py +82 -17
  139. pytensor_ml-0.3.0/tests/optim/test_lbfgs.py +163 -0
  140. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/tests/optim/test_learning_rate.py +3 -16
  141. pytensor_ml-0.3.0/tests/optim/test_line_search.py +242 -0
  142. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/tests/optim/test_policy.py +105 -3
  143. pytensor_ml-0.3.0/tests/optim/test_public_surface.py +23 -0
  144. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/tests/optim/test_rules.py +456 -26
  145. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/tests/optim/test_schedules.py +189 -1
  146. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/tests/optim/test_training.py +83 -24
  147. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/tests/optim/test_transform.py +15 -43
  148. pytensor_ml-0.3.0/tests/optim/test_update_space.py +429 -0
  149. pytensor_ml-0.3.0/tests/rewriting/__init__.py +0 -0
  150. pytensor_ml-0.3.0/tests/rewriting/test_layers.py +337 -0
  151. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/tests/rewriting/test_scan.py +165 -7
  152. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/tests/test_activations.py +30 -4
  153. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/tests/test_attention.py +138 -4
  154. pytensor_ml-0.3.0/tests/test_checkpoint.py +661 -0
  155. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/tests/test_collect.py +36 -11
  156. pytensor_ml-0.3.0/tests/test_conv.py +570 -0
  157. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/tests/test_conv_transpose.py +56 -68
  158. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/tests/test_layers.py +439 -4
  159. pytensor_ml-0.3.0/tests/test_loss.py +134 -0
  160. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/tests/test_model.py +75 -25
  161. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/tests/test_padding.py +12 -36
  162. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/tests/test_pool.py +43 -57
  163. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/tests/test_pretrained.py +254 -20
  164. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/tests/test_pytensorf.py +204 -1
  165. pytensor_ml-0.3.0/tests/test_recurrent.py +785 -0
  166. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/tests/test_serialize.py +43 -7
  167. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/tests/test_state.py +31 -0
  168. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/tests/test_transformer.py +38 -1
  169. pytensor_ml-0.3.0/tests/test_upsample.py +201 -0
  170. pytensor_ml-0.2.1/PKG-INFO +0 -43
  171. pytensor_ml-0.2.1/README.md +0 -2
  172. pytensor_ml-0.2.1/examples/mnist_feed_forward.ipynb +0 -197
  173. pytensor_ml-0.2.1/pytensor_ml/base.py +0 -65
  174. pytensor_ml-0.2.1/pytensor_ml/checkpoint.py +0 -132
  175. pytensor_ml-0.2.1/pytensor_ml/dispatch/jax/attention.py +0 -25
  176. pytensor_ml-0.2.1/pytensor_ml/layers/combinators.py +0 -51
  177. pytensor_ml-0.2.1/pytensor_ml/loss.py +0 -113
  178. pytensor_ml-0.2.1/pytensor_ml/optim/alias.py +0 -314
  179. pytensor_ml-0.2.1/pytensor_ml/optim/base.py +0 -305
  180. pytensor_ml-0.2.1/pytensor_ml/optim/clipping.py +0 -64
  181. pytensor_ml-0.2.1/pytensor_ml/optim/policy.py +0 -134
  182. pytensor_ml-0.2.1/pytensor_ml/optim/rules.py +0 -653
  183. pytensor_ml-0.2.1/pytensor_ml/optim/transform.py +0 -153
  184. pytensor_ml-0.2.1/pytensor_ml/pytensorf/collect.py +0 -192
  185. pytensor_ml-0.2.1/pytensor_ml/pytensorf/rewrite.py +0 -77
  186. pytensor_ml-0.2.1/pytensor_ml/rewriting/layers.py +0 -85
  187. pytensor_ml-0.2.1/pytensor_ml/rewriting/scan.py +0 -188
  188. pytensor_ml-0.2.1/tests/conftest.py +0 -61
  189. pytensor_ml-0.2.1/tests/optim/test_clipping.py +0 -43
  190. pytensor_ml-0.2.1/tests/rewriting/conftest.py +0 -23
  191. pytensor_ml-0.2.1/tests/rewriting/test_layers.py +0 -52
  192. pytensor_ml-0.2.1/tests/test_checkpoint.py +0 -223
  193. pytensor_ml-0.2.1/tests/test_conv.py +0 -897
  194. pytensor_ml-0.2.1/tests/test_loss.py +0 -72
  195. pytensor_ml-0.2.1/tests/test_recurrent.py +0 -1279
  196. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/.gitattributes +0 -0
  197. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/.github/workflows/mypy.yml +0 -0
  198. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/.github/workflows/pre-commit.yml +0 -0
  199. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/.github/workflows/release.yml +0 -0
  200. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/.gitignore +0 -0
  201. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/.pre-commit-config.yaml +0 -0
  202. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/LICENSE +0 -0
  203. /pytensor_ml-0.2.1/pytensor_ml/rewriting/__init__.py → /pytensor_ml-0.3.0/docs/source/_static/.gitkeep +0 -0
  204. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/pytensor_ml/dispatch/__init__.py +0 -0
  205. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/pytensor_ml/dispatch/jax/conv.py +0 -0
  206. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/pytensor_ml/dispatch/jax/pooling.py +0 -0
  207. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/pytensor_ml/dispatch/mlx/attention.py +0 -0
  208. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/pytensor_ml/dispatch/mlx/conv.py +0 -0
  209. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/pytensor_ml/dispatch/mlx/pooling.py +0 -0
  210. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/pytensor_ml/dispatch/numba/__init__.py +0 -0
  211. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/pytensor_ml/dispatch/numba/conv.py +0 -0
  212. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/pytensor_ml/dispatch/pytorch/__init__.py +0 -0
  213. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/pytensor_ml/dispatch/pytorch/conv.py +0 -0
  214. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/pytensor_ml/dispatch/pytorch/pooling.py +0 -0
  215. {pytensor_ml-0.2.1/tests → pytensor_ml-0.3.0/pytensor_ml/rewriting}/__init__.py +0 -0
  216. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/pytensor_ml/rewriting/conv.py +0 -0
  217. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/pytensor_ml/serialize/__init__.py +0 -0
  218. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/pytensor_ml/serialize/base.py +0 -0
  219. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/pytensor_ml/serialize/blockwise.py +0 -0
  220. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/pytensor_ml/serialize/builders.py +0 -0
  221. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/pytensor_ml/serialize/elemwise.py +0 -0
  222. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/pytensor_ml/serialize/scalar.py +0 -0
  223. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/pytensor_ml/serialize/scan.py +0 -0
  224. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/scripts/run_mypy.py +0 -0
  225. {pytensor_ml-0.2.1/tests/dispatch → pytensor_ml-0.3.0/tests}/__init__.py +0 -0
  226. {pytensor_ml-0.2.1/tests/dispatch/jax → pytensor_ml-0.3.0/tests/dispatch}/__init__.py +0 -0
  227. {pytensor_ml-0.2.1/tests/dispatch/mlx → pytensor_ml-0.3.0/tests/dispatch/jax}/__init__.py +0 -0
  228. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/tests/dispatch/jax/test_basic.py +0 -0
  229. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/tests/dispatch/jax/test_conv.py +0 -0
  230. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/tests/dispatch/jax/test_pool.py +0 -0
  231. {pytensor_ml-0.2.1/tests/dispatch/pytorch → pytensor_ml-0.3.0/tests/dispatch/mlx}/__init__.py +0 -0
  232. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/tests/dispatch/mlx/test_attention.py +0 -0
  233. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/tests/dispatch/mlx/test_basic.py +0 -0
  234. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/tests/dispatch/mlx/test_conv.py +0 -0
  235. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/tests/dispatch/mlx/test_pool.py +0 -0
  236. {pytensor_ml-0.2.1/tests/optim → pytensor_ml-0.3.0/tests/dispatch/pytorch}/__init__.py +0 -0
  237. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/tests/dispatch/pytorch/test_conv.py +0 -0
  238. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/tests/dispatch/pytorch/test_pool.py +0 -0
  239. {pytensor_ml-0.2.1/tests/rewriting → pytensor_ml-0.3.0/tests/models}/__init__.py +0 -0
  240. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/tests/test_base.py +0 -0
  241. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/tests/test_util.py +0 -0
  242. {pytensor_ml-0.2.1 → pytensor_ml-0.3.0}/tests/test_workflow_groups.py +0 -0
@@ -0,0 +1,30 @@
1
+ name: Read the Docs PR preview
2
+
3
+ on:
4
+ pull_request_target:
5
+ types:
6
+ - opened
7
+ - synchronize
8
+ - reopened
9
+ # Only fire when something that could change the docs build is touched.
10
+ paths:
11
+ - "docs/**"
12
+ - ".readthedocs.yaml"
13
+ - "conda_envs/environment-docs.yml"
14
+ - "examples/**"
15
+ - "pytensor_ml/**"
16
+ - "pyproject.toml"
17
+
18
+ permissions:
19
+ pull-requests: write
20
+
21
+ jobs:
22
+ documentation-links:
23
+ runs-on: ubuntu-latest
24
+ steps:
25
+ - uses: readthedocs/actions/preview@v1
26
+ with:
27
+ # Project slug as configured on Read the Docs. Verify this matches the slug shown in the
28
+ # RTD project URL (https://readthedocs.org/projects/<slug>/) once the project is imported
29
+ # there.
30
+ project-slug: "pytensor-ml"
@@ -35,15 +35,24 @@ jobs:
35
35
  paths: |
36
36
  tests/test_transformer.py
37
37
  tests/test_layers.py
38
+ - name: recurrent
39
+ paths: |
38
40
  tests/test_recurrent.py
41
+ tests/rewriting/
42
+ - name: convolution
43
+ paths: |
39
44
  tests/test_conv.py
40
45
  tests/test_conv_transpose.py
41
46
  tests/test_padding.py
42
47
  tests/test_pool.py
43
- tests/rewriting/
48
+ tests/test_upsample.py
44
49
  - name: optim
45
50
  paths: |
46
51
  tests/optim/
52
+ - name: models
53
+ paths: |
54
+ tests/test_pretrained.py
55
+ tests/models/
47
56
  - name: rest
48
57
  paths: |
49
58
  tests/test_serialize.py
@@ -51,7 +60,6 @@ jobs:
51
60
  tests/test_loss.py
52
61
  tests/test_checkpoint.py
53
62
  tests/test_model.py
54
- tests/test_pretrained.py
55
63
  tests/test_pytensorf.py
56
64
  tests/test_state.py
57
65
  tests/test_base.py
@@ -148,7 +156,7 @@ jobs:
148
156
  run: |
149
157
  conda activate pytensor_ml
150
158
  if [[ $INSTALL_JAX == "1" ]]; then pip install "jax>=0.8,<0.9.1" jaxlib; fi
151
- if [[ $INSTALL_MLX == "1" ]]; then pip install "mlx>=0.30,<0.32"; fi
159
+ if [[ $INSTALL_MLX == "1" ]]; then pip install "mlx>=0.32.2,<0.33"; fi
152
160
  if [[ $INSTALL_TORCH == "1" ]]; then pip install torch --index-url https://download.pytorch.org/whl/cpu; fi
153
161
  env:
154
162
  INSTALL_JAX: ${{ matrix.install-jax }}
@@ -0,0 +1,24 @@
1
+ version: 2
2
+
3
+ sphinx:
4
+ configuration: docs/source/conf.py
5
+ fail_on_warning: false
6
+
7
+ conda:
8
+ environment: conda_envs/environment-docs.yml
9
+
10
+ python:
11
+ install:
12
+ - method: pip
13
+ path: .
14
+
15
+ build:
16
+ os: "ubuntu-22.04"
17
+ tools:
18
+ python: "miniforge3-latest"
19
+ jobs:
20
+ # hatch-vcs derives the version from git tags; RTD's default checkout is shallow and tagless, so
21
+ # fetch tags or pytensor_ml.__version__ falls back to 0.0.0+unknown and the version selector
22
+ # labels break.
23
+ post_checkout:
24
+ - git fetch --tags --unshallow || true
@@ -0,0 +1,140 @@
1
+ Metadata-Version: 2.5
2
+ Name: pytensor_ml
3
+ Version: 0.3.0
4
+ Summary: A(nother) deep learning library, built on top of Pytensor
5
+ Project-URL: Homepage, https://github.com/pymc-devs/pytensor-ml
6
+ Project-URL: Documentation, https://pytensor-ml.readthedocs.io
7
+ Project-URL: Source, https://github.com/pymc-devs/pytensor-ml
8
+ Project-URL: Tracker, https://github.com/pymc-devs/pytensor-ml/issues
9
+ Author: Ricardo Vieira
10
+ Author-email: Jesse Grabowski <jessegrabowski@gmail.com>
11
+ License-Expression: Apache-2.0
12
+ License-File: LICENSE
13
+ Keywords: autograd,deep learning,gradient descent,neural network,pymc
14
+ Classifier: Development Status :: 2 - Pre-Alpha
15
+ Classifier: Intended Audience :: Science/Research
16
+ Classifier: Operating System :: MacOS
17
+ Classifier: Operating System :: Microsoft :: Windows
18
+ Classifier: Operating System :: POSIX
19
+ Classifier: Operating System :: Unix
20
+ Classifier: Programming Language :: Python
21
+ Classifier: Programming Language :: Python :: 3
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Programming Language :: Python :: 3.13
24
+ Classifier: Programming Language :: Python :: 3.14
25
+ Classifier: Topic :: Scientific/Engineering
26
+ Requires-Python: >=3.12
27
+ Requires-Dist: numpy
28
+ Requires-Dist: pytensor<4.0.0,>=3.3.3
29
+ Provides-Extra: dev
30
+ Requires-Dist: cloudpickle; extra == 'dev'
31
+ Requires-Dist: jax; extra == 'dev'
32
+ Requires-Dist: mypy; extra == 'dev'
33
+ Requires-Dist: pre-commit; extra == 'dev'
34
+ Requires-Dist: pytest; extra == 'dev'
35
+ Requires-Dist: pytest-cov; extra == 'dev'
36
+ Requires-Dist: pyyaml; extra == 'dev'
37
+ Requires-Dist: safetensors; extra == 'dev'
38
+ Requires-Dist: scikit-learn; extra == 'dev'
39
+ Provides-Extra: examples
40
+ Requires-Dist: matplotlib; extra == 'examples'
41
+ Requires-Dist: tqdm; extra == 'examples'
42
+ Description-Content-Type: text/markdown
43
+
44
+ # pytensor_ml
45
+
46
+ A(nother) deep learning library, built on top of [PyTensor](https://github.com/pymc-devs/pytensor).
47
+
48
+ Networks are ordinary PyTensor graphs. You build one out of layers, and everything PyTensor already does —
49
+ symbolic differentiation, graph rewrites, and compilation to Numba, C, JAX, PyTorch, or MLX — applies to it
50
+ unchanged. Training is a compiled function that takes a batch and returns a loss; there is no separate runtime
51
+ or tape.
52
+
53
+ That goes all the way down: layers are graph constructors, parameters are shared variables, and a training
54
+ step is a compiled function whose updates are the optimizer. Because a model is only a graph, it composes with
55
+ any other PyTensor graph — a PyMC model included — as there is nothing else to interoperate with.
56
+
57
+ > **Status: pre-alpha.** The API is still moving, and there is no release-to-release compatibility guarantee yet.
58
+
59
+ ## Installation
60
+
61
+ ```bash
62
+ pip install pytensor-ml
63
+ ```
64
+
65
+ The only hard dependencies are `pytensor` and `numpy`. Saving and loading weights needs `safetensors`
66
+ (`pip install safetensors`). A backend beyond the default (`numba`, `jax`, `torch`, `mlx`) is installed
67
+ separately, and only loads when you actually compile against it.
68
+
69
+ ## Quickstart
70
+
71
+ Train a classifier on scikit-learn's digits, then run inference:
72
+
73
+ ```python
74
+ import numpy as np
75
+ import pytensor
76
+
77
+ pytensor.config.floatX = "float32"
78
+
79
+ from sklearn.datasets import load_digits
80
+
81
+ from pytensor_ml.activations import ReLU
82
+ from pytensor_ml.layers import Input, Linear, Sequential
83
+ from pytensor_ml.loss import CrossEntropy
84
+ from pytensor_ml.model import Model
85
+ from pytensor_ml.optim import adam, chain, clip_by_global_norm, cosine_schedule
86
+ from pytensor_ml.util import DataLoader
87
+
88
+ X, y = load_digits(return_X_y=True)
89
+ X = (X / 16.0).astype("float32")
90
+ y_onehot = np.eye(10, dtype="float32")[y]
91
+
92
+ X_in = Input("X_in", shape=(None, 64))
93
+ network = Sequential(
94
+ Linear("fc1", n_in=64, n_out=128),
95
+ ReLU(),
96
+ Linear("logits", n_in=128, n_out=10),
97
+ )
98
+ model = Model(network(X_in)).initialize(seed=0)
99
+
100
+ rule = chain(clip_by_global_norm(1.0), adam(learning_rate=cosine_schedule(1e-3, total_steps=500)))
101
+ loss_fn = CrossEntropy(expect_onehot_labels=True, expect_logits=True, reduction="mean")
102
+ step = model.compile_train(rule, loss_fn)
103
+
104
+ loader = DataLoader(X, y_onehot, batch_size=64, random_state=0)
105
+ for _ in range(500):
106
+ loss_value = step(*loader())
107
+
108
+ accuracy = (model.predict(X).argmax(axis=-1) == y).mean()
109
+ ```
110
+
111
+ `compile_train` builds the loss against a target placeholder, differentiates it, folds in any stateful layer
112
+ updates (batch norm running statistics, RNG advances, the training clock a schedule reads), and compiles a
113
+ one-step function. `predict` compiles a separate inference pass, with dropout removed and batch norm reading
114
+ its running statistics.
115
+
116
+ ## Documentation
117
+
118
+ The full API reference and user guide live at
119
+ [pytensor-ml.readthedocs.io](https://pytensor-ml.readthedocs.io).
120
+
121
+ For worked models end to end — training loops, convolutional and recurrent networks, transformers, saving and
122
+ reloading — see the [examples gallery](https://pytensor-ml.readthedocs.io/en/latest/examples/gallery.html).
123
+
124
+ ## Contributing
125
+
126
+ Contributions are welcome. To get set up:
127
+
128
+ ```bash
129
+ pip install -e ".[dev]"
130
+ pre-commit install
131
+ pytest
132
+ ```
133
+
134
+ Formatting and linting run through `ruff` under pre-commit, and `mypy` checks `pytensor_ml/`; both also run in
135
+ CI. Bug reports and feature requests belong in the
136
+ [issue tracker](https://github.com/pymc-devs/pytensor-ml/issues).
137
+
138
+ ## License
139
+
140
+ Apache 2.0. See [LICENSE](LICENSE).
@@ -0,0 +1,97 @@
1
+ # pytensor_ml
2
+
3
+ A(nother) deep learning library, built on top of [PyTensor](https://github.com/pymc-devs/pytensor).
4
+
5
+ Networks are ordinary PyTensor graphs. You build one out of layers, and everything PyTensor already does —
6
+ symbolic differentiation, graph rewrites, and compilation to Numba, C, JAX, PyTorch, or MLX — applies to it
7
+ unchanged. Training is a compiled function that takes a batch and returns a loss; there is no separate runtime
8
+ or tape.
9
+
10
+ That goes all the way down: layers are graph constructors, parameters are shared variables, and a training
11
+ step is a compiled function whose updates are the optimizer. Because a model is only a graph, it composes with
12
+ any other PyTensor graph — a PyMC model included — as there is nothing else to interoperate with.
13
+
14
+ > **Status: pre-alpha.** The API is still moving, and there is no release-to-release compatibility guarantee yet.
15
+
16
+ ## Installation
17
+
18
+ ```bash
19
+ pip install pytensor-ml
20
+ ```
21
+
22
+ The only hard dependencies are `pytensor` and `numpy`. Saving and loading weights needs `safetensors`
23
+ (`pip install safetensors`). A backend beyond the default (`numba`, `jax`, `torch`, `mlx`) is installed
24
+ separately, and only loads when you actually compile against it.
25
+
26
+ ## Quickstart
27
+
28
+ Train a classifier on scikit-learn's digits, then run inference:
29
+
30
+ ```python
31
+ import numpy as np
32
+ import pytensor
33
+
34
+ pytensor.config.floatX = "float32"
35
+
36
+ from sklearn.datasets import load_digits
37
+
38
+ from pytensor_ml.activations import ReLU
39
+ from pytensor_ml.layers import Input, Linear, Sequential
40
+ from pytensor_ml.loss import CrossEntropy
41
+ from pytensor_ml.model import Model
42
+ from pytensor_ml.optim import adam, chain, clip_by_global_norm, cosine_schedule
43
+ from pytensor_ml.util import DataLoader
44
+
45
+ X, y = load_digits(return_X_y=True)
46
+ X = (X / 16.0).astype("float32")
47
+ y_onehot = np.eye(10, dtype="float32")[y]
48
+
49
+ X_in = Input("X_in", shape=(None, 64))
50
+ network = Sequential(
51
+ Linear("fc1", n_in=64, n_out=128),
52
+ ReLU(),
53
+ Linear("logits", n_in=128, n_out=10),
54
+ )
55
+ model = Model(network(X_in)).initialize(seed=0)
56
+
57
+ rule = chain(clip_by_global_norm(1.0), adam(learning_rate=cosine_schedule(1e-3, total_steps=500)))
58
+ loss_fn = CrossEntropy(expect_onehot_labels=True, expect_logits=True, reduction="mean")
59
+ step = model.compile_train(rule, loss_fn)
60
+
61
+ loader = DataLoader(X, y_onehot, batch_size=64, random_state=0)
62
+ for _ in range(500):
63
+ loss_value = step(*loader())
64
+
65
+ accuracy = (model.predict(X).argmax(axis=-1) == y).mean()
66
+ ```
67
+
68
+ `compile_train` builds the loss against a target placeholder, differentiates it, folds in any stateful layer
69
+ updates (batch norm running statistics, RNG advances, the training clock a schedule reads), and compiles a
70
+ one-step function. `predict` compiles a separate inference pass, with dropout removed and batch norm reading
71
+ its running statistics.
72
+
73
+ ## Documentation
74
+
75
+ The full API reference and user guide live at
76
+ [pytensor-ml.readthedocs.io](https://pytensor-ml.readthedocs.io).
77
+
78
+ For worked models end to end — training loops, convolutional and recurrent networks, transformers, saving and
79
+ reloading — see the [examples gallery](https://pytensor-ml.readthedocs.io/en/latest/examples/gallery.html).
80
+
81
+ ## Contributing
82
+
83
+ Contributions are welcome. To get set up:
84
+
85
+ ```bash
86
+ pip install -e ".[dev]"
87
+ pre-commit install
88
+ pytest
89
+ ```
90
+
91
+ Formatting and linting run through `ruff` under pre-commit, and `mypy` checks `pytensor_ml/`; both also run in
92
+ CI. Bug reports and feature requests belong in the
93
+ [issue tracker](https://github.com/pymc-devs/pytensor-ml/issues).
94
+
95
+ ## License
96
+
97
+ Apache 2.0. See [LICENSE](LICENSE).
@@ -0,0 +1,35 @@
1
+ # The environment Read the Docs builds from. `pixi run docs-build` uses the equivalent list under
2
+ # [tool.pixi.feature.docs] in pyproject.toml; the two have to move together.
3
+ name: pytensor_ml-docs
4
+ channels:
5
+ - conda-forge
6
+ - nodefaults
7
+
8
+ dependencies:
9
+ - python>=3.12
10
+ # Runtime deps: autodoc imports pytensor_ml, so the full runtime stack has to be in scope.
11
+ - pytensor>=3.3.3,<3.4.0
12
+ - numpy
13
+ - safetensors
14
+ # The gallery extension renders notebook thumbnails with matplotlib.
15
+ - matplotlib
16
+
17
+ # Docs build deps.
18
+ - ipython
19
+ - jupyter
20
+ - sphinx>=7
21
+ - pydata-sphinx-theme
22
+ - myst-nb
23
+ - numpydoc
24
+ - sphinx-copybutton
25
+ - sphinx-design
26
+ - sphinx-codeautolink
27
+ - sphinx-sitemap
28
+ - sphinx-notfound-page
29
+ - sphinx-autobuild
30
+ - jupyter-sphinx
31
+ - sphinxcontrib-bibtex
32
+ - pip
33
+ - pip:
34
+ # pytensor_ml itself so autodoc resolves the current source tree.
35
+ - -e ..
@@ -6,7 +6,7 @@ channels:
6
6
 
7
7
  dependencies:
8
8
  - python>=3.12
9
- - pytensor>=3.2.3,<4.0.0
9
+ - pytensor>=3.3.3,<4.0.0
10
10
  - numpy
11
11
  - scikit-learn
12
12
 
@@ -5,12 +5,13 @@ channels:
5
5
 
6
6
  dependencies:
7
7
  - python>=3.12
8
- - pytensor>=3.3.0,<3.4.0
8
+ - pytensor>=3.3.3,<3.4.0
9
9
  - numpy
10
10
  - safetensors
11
11
  - scikit-learn
12
12
 
13
13
  # For testing
14
+ - cloudpickle # tests/optim/test_composition.py ships a configured rule to a worker
14
15
  - coveralls
15
16
  - diff-cover
16
17
  - pytest
@@ -20,13 +21,6 @@ dependencies:
20
21
  - pytest-mock
21
22
  - pyyaml # tests/test_workflow_groups.py reads the CI matrix
22
23
 
23
- # For building docs
24
- - sphinx
25
- - sphinx_rtd_theme
26
- - pygments
27
- - pydot
28
- - ipython
29
-
30
24
  # developer tools
31
25
  - pre-commit
32
26
  # Pinned rather than floated: a local run that disagrees with CI about the version is a local run
@@ -0,0 +1,16 @@
1
+ # Sphinx build output
2
+ build/
3
+ jupyter_execute/
4
+
5
+ # Python cache
6
+ __pycache__/
7
+ *.pyc
8
+
9
+ # Autosummary-generated stubs (one .rst per object, regenerated on build)
10
+ source/api/generated/
11
+ source/api/**/generated/
12
+ source/api/**/classmethods/
13
+
14
+ # Notebook gallery artifacts written by docs/sphinxext/generate_gallery.py
15
+ source/examples/
16
+ source/_thumbnails/
@@ -0,0 +1,34 @@
1
+ # Minimal Makefile for Sphinx documentation.
2
+ # Mirrors the standard sphinx-quickstart output.
3
+
4
+ SPHINXOPTS ?=
5
+ SPHINXBUILD ?= sphinx-build
6
+ SOURCEDIR = source
7
+ BUILDDIR = build
8
+
9
+ .PHONY: help clean html show livehtml linkcheck Makefile
10
+
11
+ help:
12
+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
13
+
14
+ clean:
15
+ rm -rf "$(BUILDDIR)"
16
+ rm -rf "$(SOURCEDIR)"/api/generated
17
+ rm -rf "$(SOURCEDIR)"/api/*/generated
18
+ rm -rf "$(SOURCEDIR)"/_thumbnails
19
+ rm -f "$(SOURCEDIR)"/examples/gallery.rst
20
+
21
+ html:
22
+ @$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
23
+
24
+ show: html
25
+ @open "$(BUILDDIR)/html/index.html"
26
+
27
+ livehtml:
28
+ sphinx-autobuild "$(SOURCEDIR)" "$(BUILDDIR)/html" $(SPHINXOPTS) $(O)
29
+
30
+ linkcheck:
31
+ @$(SPHINXBUILD) -M linkcheck "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
32
+
33
+ %: Makefile
34
+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@@ -0,0 +1,29 @@
1
+ @ECHO OFF
2
+
3
+ pushd %~dp0
4
+
5
+ REM Command file for Sphinx documentation
6
+
7
+ if "%SPHINXBUILD%" == "" (
8
+ set SPHINXBUILD=sphinx-build
9
+ )
10
+ set SOURCEDIR=source
11
+ set BUILDDIR=build
12
+
13
+ %SPHINXBUILD% >NUL 2>NUL
14
+ if errorlevel 9009 (
15
+ echo.
16
+ echo.The 'sphinx-build' command was not found. Install Sphinx, then re-run.
17
+ exit /b 1
18
+ )
19
+
20
+ if "%1" == "" goto help
21
+
22
+ %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
23
+ goto end
24
+
25
+ :help
26
+ %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
27
+
28
+ :end
29
+ popd
@@ -0,0 +1,34 @@
1
+ {{ fullname | escape | underline}}
2
+
3
+ .. currentmodule:: {{ module }}
4
+
5
+ .. autoclass:: {{ objname }}
6
+
7
+ {% block methods %}
8
+ {% if methods %}
9
+
10
+ .. rubric:: Methods
11
+
12
+ .. autosummary::
13
+ :toctree: classmethods
14
+
15
+ {% for item in methods %}
16
+ {%- if item not in inherited_members %}
17
+ {{ objname }}.{{ item }}
18
+ {% endif %}
19
+ {%- endfor %}
20
+ {% endif %}
21
+ {% endblock %}
22
+
23
+ {% block attributes %}
24
+ {% if attributes %}
25
+ .. rubric:: Attributes
26
+
27
+ .. autosummary::
28
+ {% for item in attributes %}
29
+ {%- if item not in inherited_members %}
30
+ ~{{ name }}.{{ item }}
31
+ {% endif %}
32
+ {%- endfor %}
33
+ {% endif %}
34
+ {% endblock %}
@@ -0,0 +1,18 @@
1
+ Activations
2
+ ===========
3
+
4
+ .. currentmodule:: pytensor_ml.activations
5
+
6
+ .. autosummary::
7
+ :toctree: generated/
8
+
9
+ Activation
10
+ ReLU
11
+ LeakyReLU
12
+ GELU
13
+ QuickGELU
14
+ Swish
15
+ Sigmoid
16
+ SoftPlus
17
+ Softmax
18
+ Tanh
@@ -0,0 +1,104 @@
1
+ Layers
2
+ ======
3
+
4
+ .. currentmodule:: pytensor_ml.layers
5
+
6
+ Base
7
+ ----
8
+
9
+ .. autosummary::
10
+ :toctree: generated/
11
+
12
+ Layer
13
+
14
+ Combinators
15
+ -----------
16
+
17
+ .. autosummary::
18
+ :toctree: generated/
19
+
20
+ Input
21
+ Sequential
22
+ Concatenate
23
+ Flatten
24
+ Squeeze
25
+
26
+ Dense
27
+ -----
28
+
29
+ .. autosummary::
30
+ :toctree: generated/
31
+
32
+ Linear
33
+ Embedding
34
+
35
+ Convolution and pooling
36
+ -----------------------
37
+
38
+ .. autosummary::
39
+ :toctree: generated/
40
+
41
+ Conv1D
42
+ Conv2D
43
+ ConvTranspose1D
44
+ ConvTranspose2D
45
+ MaxPool1D
46
+ MaxPool2D
47
+ AvgPool1D
48
+ AvgPool2D
49
+ Upsample1D
50
+ Upsample2D
51
+
52
+ Padding
53
+ -------
54
+
55
+ .. autosummary::
56
+ :toctree: generated/
57
+
58
+ ZeroPad1D
59
+ ZeroPad2D
60
+ ConstantPad1D
61
+ ConstantPad2D
62
+ ReflectionPad1D
63
+ ReflectionPad2D
64
+ ReplicationPad1D
65
+ ReplicationPad2D
66
+
67
+ Normalization and regularization
68
+ --------------------------------
69
+
70
+ .. autosummary::
71
+ :toctree: generated/
72
+
73
+ BatchNorm
74
+ LayerNorm
75
+ GroupNorm
76
+ Dropout
77
+
78
+ Recurrent
79
+ ---------
80
+
81
+ .. autosummary::
82
+ :toctree: generated/
83
+
84
+ RNN
85
+ LSTM
86
+ GRU
87
+ Bidirectional
88
+ Recurrent
89
+ RecurrentCell
90
+ ElmanCell
91
+ LSTMCell
92
+ GRUCell
93
+
94
+ Attention and transformers
95
+ --------------------------
96
+
97
+ .. autosummary::
98
+ :toctree: generated/
99
+
100
+ MultiheadAttention
101
+ CausalSelfAttention
102
+ FeedForward
103
+ TransformerBlock
104
+ scaled_dot_product_attention
@@ -0,0 +1,12 @@
1
+ Losses
2
+ ======
3
+
4
+ .. currentmodule:: pytensor_ml.loss
5
+
6
+ .. autosummary::
7
+ :toctree: generated/
8
+
9
+ Loss
10
+ SquaredError
11
+ CrossEntropy
12
+ supervised_loss
@@ -0,0 +1,9 @@
1
+ Model
2
+ =====
3
+
4
+ .. currentmodule:: pytensor_ml.model
5
+
6
+ .. autosummary::
7
+ :toctree: generated/
8
+
9
+ Model