keras-nightly 3.12.0.dev2025083103__py3-none-any.whl → 3.14.0.dev2026011604__py3-none-any.whl

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 (164) hide show
  1. keras/__init__.py +1 -0
  2. keras/_tf_keras/keras/__init__.py +1 -0
  3. keras/_tf_keras/keras/callbacks/__init__.py +3 -0
  4. keras/_tf_keras/keras/distillation/__init__.py +16 -0
  5. keras/_tf_keras/keras/distribution/__init__.py +3 -0
  6. keras/_tf_keras/keras/dtype_policies/__init__.py +6 -0
  7. keras/_tf_keras/keras/layers/__init__.py +21 -0
  8. keras/_tf_keras/keras/ops/__init__.py +16 -0
  9. keras/_tf_keras/keras/ops/image/__init__.py +1 -0
  10. keras/_tf_keras/keras/ops/linalg/__init__.py +1 -0
  11. keras/_tf_keras/keras/ops/nn/__init__.py +3 -0
  12. keras/_tf_keras/keras/ops/numpy/__init__.py +12 -0
  13. keras/_tf_keras/keras/quantizers/__init__.py +13 -0
  14. keras/callbacks/__init__.py +3 -0
  15. keras/distillation/__init__.py +16 -0
  16. keras/distribution/__init__.py +3 -0
  17. keras/dtype_policies/__init__.py +6 -0
  18. keras/layers/__init__.py +21 -0
  19. keras/ops/__init__.py +16 -0
  20. keras/ops/image/__init__.py +1 -0
  21. keras/ops/linalg/__init__.py +1 -0
  22. keras/ops/nn/__init__.py +3 -0
  23. keras/ops/numpy/__init__.py +12 -0
  24. keras/quantizers/__init__.py +13 -0
  25. keras/src/applications/imagenet_utils.py +4 -1
  26. keras/src/backend/common/backend_utils.py +30 -6
  27. keras/src/backend/common/dtypes.py +6 -12
  28. keras/src/backend/common/name_scope.py +2 -1
  29. keras/src/backend/common/variables.py +38 -20
  30. keras/src/backend/jax/core.py +126 -78
  31. keras/src/backend/jax/distribution_lib.py +16 -2
  32. keras/src/backend/jax/layer.py +3 -1
  33. keras/src/backend/jax/linalg.py +4 -0
  34. keras/src/backend/jax/nn.py +511 -29
  35. keras/src/backend/jax/numpy.py +109 -23
  36. keras/src/backend/jax/optimizer.py +3 -2
  37. keras/src/backend/jax/trainer.py +18 -3
  38. keras/src/backend/numpy/linalg.py +4 -0
  39. keras/src/backend/numpy/nn.py +313 -2
  40. keras/src/backend/numpy/numpy.py +97 -8
  41. keras/src/backend/openvino/__init__.py +1 -0
  42. keras/src/backend/openvino/core.py +6 -23
  43. keras/src/backend/openvino/linalg.py +4 -0
  44. keras/src/backend/openvino/nn.py +271 -20
  45. keras/src/backend/openvino/numpy.py +1369 -195
  46. keras/src/backend/openvino/random.py +7 -14
  47. keras/src/backend/tensorflow/layer.py +43 -9
  48. keras/src/backend/tensorflow/linalg.py +24 -0
  49. keras/src/backend/tensorflow/nn.py +545 -1
  50. keras/src/backend/tensorflow/numpy.py +351 -56
  51. keras/src/backend/tensorflow/trainer.py +6 -2
  52. keras/src/backend/torch/core.py +3 -1
  53. keras/src/backend/torch/linalg.py +4 -0
  54. keras/src/backend/torch/nn.py +125 -0
  55. keras/src/backend/torch/numpy.py +109 -9
  56. keras/src/backend/torch/trainer.py +8 -2
  57. keras/src/callbacks/__init__.py +1 -0
  58. keras/src/callbacks/callback_list.py +45 -11
  59. keras/src/callbacks/model_checkpoint.py +5 -0
  60. keras/src/callbacks/orbax_checkpoint.py +332 -0
  61. keras/src/callbacks/terminate_on_nan.py +54 -5
  62. keras/src/datasets/cifar10.py +5 -0
  63. keras/src/distillation/__init__.py +1 -0
  64. keras/src/distillation/distillation_loss.py +390 -0
  65. keras/src/distillation/distiller.py +598 -0
  66. keras/src/distribution/distribution_lib.py +14 -0
  67. keras/src/dtype_policies/__init__.py +4 -0
  68. keras/src/dtype_policies/dtype_policy.py +180 -1
  69. keras/src/export/__init__.py +2 -0
  70. keras/src/export/export_utils.py +39 -2
  71. keras/src/export/litert.py +248 -0
  72. keras/src/export/onnx.py +6 -0
  73. keras/src/export/openvino.py +1 -1
  74. keras/src/export/tf2onnx_lib.py +3 -0
  75. keras/src/layers/__init__.py +13 -0
  76. keras/src/layers/activations/softmax.py +9 -4
  77. keras/src/layers/attention/attention.py +1 -1
  78. keras/src/layers/attention/multi_head_attention.py +4 -1
  79. keras/src/layers/core/dense.py +406 -102
  80. keras/src/layers/core/einsum_dense.py +521 -116
  81. keras/src/layers/core/embedding.py +257 -99
  82. keras/src/layers/core/input_layer.py +1 -0
  83. keras/src/layers/core/reversible_embedding.py +399 -0
  84. keras/src/layers/input_spec.py +17 -17
  85. keras/src/layers/layer.py +50 -15
  86. keras/src/layers/merging/concatenate.py +6 -5
  87. keras/src/layers/merging/dot.py +4 -1
  88. keras/src/layers/pooling/adaptive_average_pooling1d.py +65 -0
  89. keras/src/layers/pooling/adaptive_average_pooling2d.py +62 -0
  90. keras/src/layers/pooling/adaptive_average_pooling3d.py +63 -0
  91. keras/src/layers/pooling/adaptive_max_pooling1d.py +65 -0
  92. keras/src/layers/pooling/adaptive_max_pooling2d.py +62 -0
  93. keras/src/layers/pooling/adaptive_max_pooling3d.py +63 -0
  94. keras/src/layers/pooling/base_adaptive_pooling.py +63 -0
  95. keras/src/layers/preprocessing/discretization.py +6 -5
  96. keras/src/layers/preprocessing/feature_space.py +8 -4
  97. keras/src/layers/preprocessing/image_preprocessing/aug_mix.py +2 -2
  98. keras/src/layers/preprocessing/image_preprocessing/bounding_boxes/validation.py +5 -5
  99. keras/src/layers/preprocessing/image_preprocessing/random_contrast.py +3 -3
  100. keras/src/layers/preprocessing/image_preprocessing/resizing.py +10 -0
  101. keras/src/layers/preprocessing/index_lookup.py +19 -1
  102. keras/src/layers/preprocessing/normalization.py +16 -1
  103. keras/src/layers/preprocessing/string_lookup.py +26 -28
  104. keras/src/layers/regularization/dropout.py +43 -1
  105. keras/src/layers/rnn/gru.py +1 -1
  106. keras/src/layers/rnn/lstm.py +2 -2
  107. keras/src/layers/rnn/rnn.py +19 -0
  108. keras/src/layers/rnn/simple_rnn.py +1 -1
  109. keras/src/legacy/preprocessing/image.py +4 -1
  110. keras/src/legacy/preprocessing/sequence.py +20 -12
  111. keras/src/losses/loss.py +1 -1
  112. keras/src/losses/losses.py +24 -0
  113. keras/src/metrics/confusion_metrics.py +7 -6
  114. keras/src/models/cloning.py +4 -0
  115. keras/src/models/functional.py +11 -3
  116. keras/src/models/model.py +195 -44
  117. keras/src/ops/image.py +257 -20
  118. keras/src/ops/linalg.py +93 -0
  119. keras/src/ops/nn.py +268 -2
  120. keras/src/ops/numpy.py +701 -44
  121. keras/src/ops/operation.py +90 -29
  122. keras/src/ops/operation_utils.py +2 -0
  123. keras/src/optimizers/adafactor.py +29 -10
  124. keras/src/optimizers/base_optimizer.py +22 -3
  125. keras/src/optimizers/loss_scale_optimizer.py +51 -18
  126. keras/src/optimizers/muon.py +65 -31
  127. keras/src/optimizers/schedules/learning_rate_schedule.py +4 -3
  128. keras/src/quantizers/__init__.py +14 -1
  129. keras/src/quantizers/awq.py +361 -0
  130. keras/src/quantizers/awq_config.py +140 -0
  131. keras/src/quantizers/awq_core.py +217 -0
  132. keras/src/quantizers/gptq.py +346 -207
  133. keras/src/quantizers/gptq_config.py +63 -13
  134. keras/src/quantizers/gptq_core.py +328 -215
  135. keras/src/quantizers/quantization_config.py +246 -0
  136. keras/src/quantizers/quantizers.py +407 -38
  137. keras/src/quantizers/utils.py +23 -0
  138. keras/src/random/seed_generator.py +6 -4
  139. keras/src/saving/file_editor.py +81 -6
  140. keras/src/saving/orbax_util.py +26 -0
  141. keras/src/saving/saving_api.py +37 -14
  142. keras/src/saving/saving_lib.py +1 -1
  143. keras/src/testing/__init__.py +1 -0
  144. keras/src/testing/test_case.py +45 -5
  145. keras/src/trainers/compile_utils.py +38 -17
  146. keras/src/trainers/data_adapters/grain_dataset_adapter.py +1 -5
  147. keras/src/tree/torchtree_impl.py +215 -0
  148. keras/src/tree/tree_api.py +6 -1
  149. keras/src/utils/backend_utils.py +31 -4
  150. keras/src/utils/dataset_utils.py +234 -35
  151. keras/src/utils/file_utils.py +49 -11
  152. keras/src/utils/image_utils.py +14 -2
  153. keras/src/utils/jax_layer.py +244 -55
  154. keras/src/utils/module_utils.py +29 -0
  155. keras/src/utils/progbar.py +10 -12
  156. keras/src/utils/python_utils.py +5 -0
  157. keras/src/utils/rng_utils.py +9 -1
  158. keras/src/utils/tracking.py +70 -5
  159. keras/src/version.py +1 -1
  160. {keras_nightly-3.12.0.dev2025083103.dist-info → keras_nightly-3.14.0.dev2026011604.dist-info}/METADATA +16 -6
  161. {keras_nightly-3.12.0.dev2025083103.dist-info → keras_nightly-3.14.0.dev2026011604.dist-info}/RECORD +163 -142
  162. keras/src/quantizers/gptq_quant.py +0 -133
  163. {keras_nightly-3.12.0.dev2025083103.dist-info → keras_nightly-3.14.0.dev2026011604.dist-info}/WHEEL +0 -0
  164. {keras_nightly-3.12.0.dev2025083103.dist-info → keras_nightly-3.14.0.dev2026011604.dist-info}/top_level.txt +0 -0
@@ -31,13 +31,13 @@ def no_automatic_dependency_tracking(fn):
31
31
  class Tracker:
32
32
  """Attribute tracker, used for e.g. Variable tracking.
33
33
 
34
- Monitors certain attribute types
35
- and put them in appropriate lists in case of a match.
34
+ Monitors certain attribute types and places matching
35
+ objects into user provided tracking collections.
36
36
 
37
37
  Also passively tracks certain mutable collections
38
- (dict, list) so that items added to them later
39
- still get tracked. This is done by wrapping these
40
- collections into an equivalent, tracking-aware object.
38
+ (e.g. dict and list) ensuring that items added after
39
+ initialization are still tracked. This is done by wrapping
40
+ these collections in tracking-aware proxy objects.
41
41
 
42
42
  Example:
43
43
 
@@ -193,6 +193,27 @@ class TrackedList(list):
193
193
  # For optree / dmtree
194
194
  return cls(children)
195
195
 
196
+ def torchtree_flatten(self):
197
+ # For torchtree
198
+ # Returns (values, metadata)
199
+ return (self, None)
200
+
201
+ @classmethod
202
+ def torchtree_unflatten(cls, children, metadata):
203
+ # For torchtree
204
+ # Requires (children, metadata)
205
+ return cls(children)
206
+
207
+ def torchtree_flatten_with_keys(self):
208
+ # For torchtree
209
+ # Returns (children, metadata)
210
+ from torch.utils import _pytree as torch_tree
211
+
212
+ values, context = self.torchtree_flatten()
213
+ return [
214
+ (torch_tree.SequenceKey(i), v) for i, v in enumerate(values)
215
+ ], context
216
+
196
217
 
197
218
  @tree.register_tree_node_class
198
219
  class TrackedDict(dict):
@@ -244,6 +265,29 @@ class TrackedDict(dict):
244
265
  # For optree / dmtree
245
266
  return cls(zip(keys, values))
246
267
 
268
+ def torchtree_flatten(self):
269
+ # For torch_tree
270
+ # Returns (values, metadata)
271
+ keys = sorted(list(self.keys()))
272
+ values = [self[k] for k in keys]
273
+ return values, keys
274
+
275
+ @classmethod
276
+ def torchtree_unflatten(cls, values, keys):
277
+ # For torch_tree
278
+ # Requires (children, metadata)
279
+ return cls(zip(keys, values))
280
+
281
+ def torchtree_flatten_with_keys(self):
282
+ # For torchtree
283
+ # Returns (children, metadata)
284
+ from torch.utils import _pytree as torch_tree
285
+
286
+ values, context = self.torchtree_flatten()
287
+ return [
288
+ (torch_tree.MappingKey(k), v) for k, v in zip(context, values)
289
+ ], context
290
+
247
291
 
248
292
  @tree.register_tree_node_class
249
293
  class TrackedSet(set):
@@ -288,3 +332,24 @@ class TrackedSet(set):
288
332
  def tree_unflatten(cls, metadata, children):
289
333
  # For optree / dmtree
290
334
  return cls(children)
335
+
336
+ def torchtree_flatten(self):
337
+ # For torchtree
338
+ # Returns (values, metadata)
339
+ return (self, None)
340
+
341
+ @classmethod
342
+ def torchtree_unflatten(cls, children, metadata):
343
+ # For torchtree
344
+ # Requires (values, metadata)
345
+ return cls(children)
346
+
347
+ def torchtree_flatten_with_keys(self):
348
+ # For torchtree
349
+ # Returns (children, metadata)
350
+ from torch.utils import _pytree as torch_tree
351
+
352
+ values, context = self.torchtree_flatten()
353
+ return [
354
+ (torch_tree.SequenceKey(i), v) for i, v in enumerate(values)
355
+ ], context
keras/src/version.py CHANGED
@@ -1,7 +1,7 @@
1
1
  from keras.src.api_export import keras_export
2
2
 
3
3
  # Unique source of truth for the version number.
4
- __version__ = "3.12.0.dev2025083103"
4
+ __version__ = "3.14.0.dev2026011604"
5
5
 
6
6
 
7
7
  @keras_export("keras.version")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: keras-nightly
3
- Version: 3.12.0.dev2025083103
3
+ Version: 3.14.0.dev2026011604
4
4
  Summary: Multi-backend Keras
5
5
  Author-email: Keras team <keras-users@googlegroups.com>
6
6
  License: Apache License 2.0
@@ -8,15 +8,15 @@ Project-URL: Home, https://keras.io/
8
8
  Project-URL: Repository, https://github.com/keras-team/keras
9
9
  Classifier: Development Status :: 4 - Beta
10
10
  Classifier: Programming Language :: Python :: 3
11
- Classifier: Programming Language :: Python :: 3.10
12
11
  Classifier: Programming Language :: Python :: 3.11
12
+ Classifier: Programming Language :: Python :: 3.12
13
13
  Classifier: Programming Language :: Python :: 3 :: Only
14
14
  Classifier: Operating System :: Unix
15
15
  Classifier: Operating System :: MacOS
16
16
  Classifier: Intended Audience :: Science/Research
17
17
  Classifier: Topic :: Scientific/Engineering
18
18
  Classifier: Topic :: Software Development
19
- Requires-Python: >=3.10
19
+ Requires-Python: >=3.11
20
20
  Description-Content-Type: text/markdown
21
21
  Requires-Dist: absl-py
22
22
  Requires-Dist: numpy
@@ -56,9 +56,8 @@ pip install keras --upgrade
56
56
 
57
57
  2. Install backend package(s).
58
58
 
59
- To use `keras`, you should also install the backend of choice: `tensorflow`, `jax`, or `torch`.
60
- Note that `tensorflow` is required for using certain Keras 3 features: certain preprocessing layers
61
- as well as `tf.data` pipelines.
59
+ To use `keras`, you should also install the backend of choice: `tensorflow`, `jax`, or `torch`. Additionally,
60
+ The `openvino` backend is available with support for model inference only.
62
61
 
63
62
  ### Local installation
64
63
 
@@ -85,6 +84,17 @@ python pip_build.py --install
85
84
  ./shell/api_gen.sh
86
85
  ```
87
86
 
87
+ ## Backend Compatibility Table
88
+
89
+ The following table lists the minimum supported versions of each backend for the latest stable release of Keras (v3.x):
90
+
91
+ | Backend | Minimum Supported Version |
92
+ |------------|---------------------------|
93
+ | TensorFlow | 2.16.1 |
94
+ | JAX | 0.4.20 |
95
+ | PyTorch | 2.1.0 |
96
+ | OpenVINO | 2025.3.0 |
97
+
88
98
  #### Adding GPU support
89
99
 
90
100
  The `requirements.txt` file will install a CPU-only version of TensorFlow, JAX, and PyTorch. For GPU support, we also