Commit Graph

1060 Commits

Author SHA1 Message Date
Russell Power
3e326c8dba Split out SymbolicTensor type from base Tensor.
This creates an explicit class for symbolic tensors.

The Tensor base class remains shared between Eager and Graph tensors, but
becomes a pure interface type.

PiperOrigin-RevId: 529748789
2023-05-05 10:21:21 -07:00
Venkat Ram Konijeti
d8c061aab5 We cut the branch for 2.13.0. Insert new blurb for new release notes TF 2.14.0.
PiperOrigin-RevId: 528579685
2023-05-01 14:49:15 -07:00
A. Unique TensorFlower
761358a812 Add UI32 Support for Pack
PiperOrigin-RevId: 528544951
2023-05-01 12:38:17 -07:00
Laura Pak
83b395bbc4 Announce sunset of TFSAs, moving to rely solely on CVEs.
PiperOrigin-RevId: 527928968
2023-04-28 10:55:17 -07:00
Ramesh Sampath
23fb0fdac6 Add Keras Public / Private API Guideline to release notes for TF 2.13
PiperOrigin-RevId: 527660910
2023-04-27 13:07:41 -07:00
A. Unique TensorFlower
3ad1609e0f Update the API docs and Release notes to document the new behavior and recommended usage for tf.data.Dataset.shuffle.
PiperOrigin-RevId: 527078649
2023-04-25 14:42:14 -07:00
Scott Zhu
011a1fd032 Remove the deprecated tf.keras.dtensor.experimental.layout_map_scope API.
The deprecated warning was showing up when using the `LayoutMap.scope`, which is confusing to end user.

PiperOrigin-RevId: 526818762
2023-04-24 19:22:20 -07:00
Weiyi Wang
8e633f47c6 tf.lite. Add support for i16 to topK
PiperOrigin-RevId: 525806442
2023-04-20 11:59:37 -07:00
TensorFlower Gardener
21c982484f Merge pull request #52576 from johan-gras:upstream/batchspaceint16
PiperOrigin-RevId: 525449619
2023-04-19 08:06:43 -07:00
Ramesh Sampath
f3e12ef46a Adds TimedThread to keras.utils. This utility be useful if we want to run a function every x seconds while the training loop is running.
PiperOrigin-RevId: 523572226
2023-04-11 19:21:06 -07:00
Antonio Sanchez
ecdab50a57 Allow variable k type and output index type in topk.
This is to help support smaller model sizes for some
tflite models. Requires expanding the TF API to allow
specification of the type, `index_type`.
The change is backward-compatible.

Some changes in XLA were required to support the new
API.

PiperOrigin-RevId: 523499712
2023-04-11 14:19:02 -07:00
Fiona Lang
f0c868f597 Change resource_variable_ops.BaseResourceVariable to inherit from variables.Variable instead of variables.VariableV1.
PiperOrigin-RevId: 522596714
2023-04-07 07:56:37 -07:00
Alan Kelly
fa91e7a33b Add supports broadcasting up to 6 dimensions
PiperOrigin-RevId: 521450724
2023-04-03 07:21:08 -07:00
Eric Yang
bfd76f88e8 Support TFLite RightShift op for 8-bit/16-bit/32-bit integer/unsigned integer
PiperOrigin-RevId: 520517202
2023-03-29 20:31:44 -07:00
Eric Yang
fd714e7701 Support TFLite BitwiseXor op for 8-bit/16-bit/32-bit integer/unsigned integer
PiperOrigin-RevId: 520507082
2023-03-29 19:35:49 -07:00
Kaan
071835a427 PR #17651: Add CategoricalFocalCrossentropy to Losses API
Imported from GitHub PR https://github.com/keras-team/keras/pull/17651

Implements the `CategoricalFocalCrossentropy()` loss based on the paper [Focal Loss for Dense Object Detection](https://arxiv.org/pdf/1708.02002.pdf) (Lin et al., 2018).

Feature request was made in #17583.
Copybara import of the project:

--
5696b5ab7dd401ca15b7e6ffba17ef05b1bb012a by Kaan Bıçakcı <kaan.dvlpr@gmail.com>:

Add pure logic of CFCE

--
40e547feaf8a505e559fac6818780c985963f8cc by Kaan Bıçakcı <kaan.dvlpr@gmail.com>:

Add support for ragged tensors

--
d3dd32f0a6fe7f5d90cf579677c905ebb2597328 by Kaan Bıçakcı <kaan.dvlpr@gmail.com>:

Make sure output sum equals 1

--
16adf8571a5f6415e3adb54415bf09d351fdf3af by Kaan Bıçakcı <kaan.dvlpr@gmail.com>:

Raise shape mismatch / update tests

--
bc38e33153715846c5faaacb02f4e354a22b0561 by Kaan Bıçakcı <kaan.dvlpr@gmail.com>:

Add categorical_focal_loss tests

--
363baaf4c8c508de5a333b1e75a8cf6bbb9b6183 by Kaan Bıçakcı <kaan.dvlpr@gmail.com>:

Add documentation / minor fix.

--
c267fa0a118dc748707e50c36d33838a9f55776d by Kaan Bıçakcı <kaan.dvlpr@gmail.com>:

Reformatting after focal loss implementation

--
3c33117f62a7580b4a17f394c797edf2f80b6972 by Kaan Bıçakcı <kaan.dvlpr@gmail.com>:

Fix linting.

--
3538622ace799cf1d9a5dd279af90098965665c3 by Kaan Bıçakcı <kaan.dvlpr@gmail.com>:

Fix docstring style.

--
6b4fa6b0dbba7351aa98fa2b39b74e82b85f5b54 by Kaan Bıçakcı <kaan.dvlpr@gmail.com>:

Update the docstrings.

--
49c03a2e1214cd7057dd5381c9602eebeaa4ff18 by Kaan Bıçakcı <kaan.dvlpr@gmail.com>:

Fix linting issues

--
f56033645287df77f6fd0c0741bb16b74090f0eb by Kaan Bıçakcı <kaan.dvlpr@gmail.com>:

Address comments from code-review.

Merging this change closes #17651

PiperOrigin-RevId: 520482950
2023-03-29 17:19:24 -07:00
Ashish Shenoy
2060260544 Update TF release notes announcing tf.nest.is_sequence removal.
PiperOrigin-RevId: 520419980
2023-03-29 13:09:26 -07:00
Bc. Martin Kubovčík
afec73aba0 PR #17648: SpectralNormalization
Imported from GitHub PR https://github.com/keras-team/keras/pull/17648

Hello,

  here is the adapted `SpectralNormalization` from TF-Addons implementation.

Thanks.
Copybara import of the project:

--
0ae1ae70024b548fc2aee47c976ca4c30530157f by Martin Kubovcik <markub3327@gmail.com>:

+ SpectralNormalization

--
7f91062eea8d23f6407a2c3bc253e82e48a52e30 by Martin Kubovcik <markub3327@gmail.com>:

fixes

--
5fbe19ecadbdf69acb13f1b3aac3c411b1427c83 by Martin Kubovcik <markub3327@gmail.com>:

fix

--
f57b45aa5a635a3d75ec957e9ca3f7ce5984421c by Martin Kubovcik <markub3327@gmail.com>:

update

--
46269ea5fc5d404051c47a7eadcd42acd2a62ad6 by Martin Kubovcik <markub3327@gmail.com>:

update tests

Merging this change closes #17648

PiperOrigin-RevId: 520171696
2023-03-28 16:56:08 -07:00
Ian Stenbit
d17f7dfe5a Support class_weight for 3+ dimensional data in model.fit
PiperOrigin-RevId: 519731299
2023-03-27 08:41:45 -07:00
A. Unique TensorFlower
2c5c778484 Support class_weight for 3+ dimensional data in model.fit
PiperOrigin-RevId: 519185840
2023-03-24 11:05:38 -07:00
Venkat Ram Konijeti
0595e773e2 Merge release notes for the latest TF 2.12 final releases.
PiperOrigin-RevId: 519152824
2023-03-24 08:44:35 -07:00
A. Unique TensorFlower
e43a79fe70 Support class_weight for 3+ dimensional data in model.fit
PiperOrigin-RevId: 519044002
2023-03-23 21:33:40 -07:00
A. Unique TensorFlower
393c089f45 Add pybind for single device layout.
Also open source the layout test files, and split the LayoutPropagation tests from layout test to speed up the test target a bit.

PiperOrigin-RevId: 518682489
2023-03-22 15:07:26 -07:00
Weiyi Wang
ace4433238 Add builtin op bitcast
Add 16 bit and 32 bit int / uint support for bitcast

PiperOrigin-RevId: 518628216
2023-03-22 11:41:15 -07:00
A. Unique TensorFlower
d0227956e9 [tfl] Add (unquantized) Int16 and Uint32 support for Mul
PiperOrigin-RevId: 518603054
2023-03-22 10:18:09 -07:00
Scott Zhu
1681b14328 Merge the dtensor.optimizer to keras.optimizer.
1. All the optimizers and the base optimizer will take a new kwargs `mesh`, which will convert of the some behavior to DTensor, (eg DVariable for state variable, and some other reduction/aggregation logic.)

2. Delete all the implementation under dtensor/optimizers.py, but keep the tests to make sure the optimizers are covered for the dtensor setting.

3. Move the existing dtensor.optimizer export to the keras.optimizer, will keep it for one release cycle, and will delete them later.

PiperOrigin-RevId: 518367856
2023-03-21 13:41:45 -07:00
Jun Xu
ec8341df31 Support Python tuple as the type annotation of ExtensionType fields.
Previously issubclass(tuple[int, int], composite_tensor.CompositeTensor) raises a TypeError. This CL creates an internal _issubclass to only return True or False. So the original TypeError will not be raised. The Python tuple annotation was already correctly handled by the `type_annotations.is_generic_tuple` logic below.

PiperOrigin-RevId: 518309384
2023-03-21 10:22:21 -07:00
A. Unique TensorFlower
7afc16b117 #tf-data Support Python-style zipping in tf.data.Dataset.zip
The current behavior is unchanged to avoid affecting backward compatibility but only added a new behavior to `tf.data.Dataset.zip` Python op for accepting a non-nested structure of datasets without doing the tuple.

PiperOrigin-RevId: 517472001
2023-03-17 12:05:45 -07:00
A. Unique TensorFlower
bf65880ef4 Layout delegates most of the functionality to C++.
A few unused methods are removed to slightly reduce the API surface.

PiperOrigin-RevId: 516617922
2023-03-14 13:40:11 -07:00
Malo Huard
86a6ae6486 PR #17605: Add Lion optimizer
Imported from GitHub PR https://github.com/keras-team/keras/pull/17605

Add Lion optimizer to keras, using the experimental optimizer API.
Authors [implementation](http://github.com/google/automl/tree/master/lion) is based on legacy optimizer API.

Request for contribution was made [here](https://github.com/keras-team/keras/issues/17570)
Copybara import of the project:

--
89ba3e45094943931d577c9c21194aaec1764f97 by Malo <malo@milvue.com>:

Add Lion optimizer

--
6074929ccdfd2d4889a7c039e8b7163236c3533a by Malo <malo@milvue.com>:

Add missing docstring, remove checks

--
51041a5915c772a67314781c186639184993884a by Malo <malo@milvue.com>:

improve update step

--
0e0d77fd5f1544545980e9388bb0264751e01997 by Malo <malo@milvue.com>:

remove not needed stuff

--
2ede9c711ecdc731d644bc913944fe24d1b45c8c by Malo <malo@milvue.com>:

add lr and wd value recommendation

--
2a8e49939b37791f39b8f537bbe54e1f7187a376 by Malo <malo@milvue.com>:

allow beta_1 = 0

--
61224483219906ce4889cc9e94408ffa12d29b19 by Malo <malo@milvue.com>:

revert beta_1 = 0 and add correctness test

--
b368b93f88f4c9cedf0f0fe0c4a480d795f231ca by Malo <malo@milvue.com>:

add missing newline

--
4901592dd143f682c5ca43861dc5917977ee41dc by Malo <malo@milvue.com>:

revert back to register_keras + print value

--
fee5345c724ff53c056055a151c2f39b1445797e by Malo <malo@milvue.com>:

improve error message

Merging this change closes #17605

PiperOrigin-RevId: 516388327
2023-03-13 19:16:57 -07:00
Adam Cogdell
03fd965e1e Add canonical singleprint method to c++/python to easily and uniquely identify a SavedModel.
PiperOrigin-RevId: 516332423
2023-03-13 15:04:50 -07:00
Scott Zhu
f6aeedfa1e Expose Normal/Ragged/Sparse KerasTensor as public API.
Although they are still implementation details, this will allow user to do type checking as well as type annotation for their code.

PiperOrigin-RevId: 516295859
2023-03-13 12:59:18 -07:00
James Mullenbach
adf19219ed Enable visitation guarantee for model evaluation when using ParameterServerStrategy. Off by default for now.
Uses local Variables via `experimental_enable_variable_lifting=False` to create short-lived Metric objects within each eval function. These metrics' variables are returned for aggregation on the chief.

PiperOrigin-RevId: 515634213
2023-03-10 07:48:33 -08:00
Weiyi Wang
3bf7e7333a [tfl] Add support to i16 indices to gather_nd
PiperOrigin-RevId: 515491861
2023-03-09 17:57:09 -08:00
Andrew Audibert
d89fc44d0e #tf-data Support Python-style zipping in tf.data.Dataset.zip
The current behavior is unchanged to avoid affecting backward compatibility but only added a new behavior to `tf.data.Dataset.zip` Python op for accepting a non-nested structure of datasets without doing the tuple.

PiperOrigin-RevId: 515440530
2023-03-09 14:28:24 -08:00
Adam Cogdell
b01db583ac Replace GetFingerprintMap() and MaybeReadSavedModelChecksum() with ReadSavedModelFingerprint().
PiperOrigin-RevId: 515432111
2023-03-09 14:01:37 -08:00
A. Unique TensorFlower
fe1cc8d2c4 #tf-data Support Python-style zipping in tf.data.Dataset.zip
The current behavior is unchanged to avoid affecting backward compatibility but only added a new behavior to `tf.data.Dataset.zip` Python op for accepting a non-nested structure of datasets without doing the tuple.

PiperOrigin-RevId: 515389129
2023-03-09 11:16:01 -08:00
Weiyi Wang
f4c6e07c78 [tfl] Add (unquantized) Int16 support for Add
PiperOrigin-RevId: 515104143
2023-03-08 12:10:39 -08:00
TensorFlower Gardener
3a5278f6b7 Merge pull request #58278 from Tessil:toupstream/int8_int16_exp_lut
PiperOrigin-RevId: 514659158
2023-03-07 01:37:37 -08:00
Mihai Maruseac
dc57d03368 Drop LMDB dependency, replace kernels/ops with error Status.
This is because LMDB has vulnerabilities and there are very few users of this feature, so it does not make sense to include it in TF.

PiperOrigin-RevId: 514551603
2023-03-06 16:02:34 -08:00
TensorFlower Gardener
4c08fd787d Merge pull request #59788 from philipphack:uu_sparse_embedding
PiperOrigin-RevId: 514487707
2023-03-06 13:09:25 -08:00
Philipp Hack
7467439cf2 Performance enhancements for sparse embedding lookups. 2023-03-06 18:46:43 +00:00
Srujun Thanmay Gupta
85151a471c Add dtensor.default_mesh() as a replacement for dtensor.run_on().
dtensor.run_on() tends to cause confusion since it indicates override semantics (force the functions and ops in the context to run on the supplied mesh), even though the implementation only provides fallback semantics.

PiperOrigin-RevId: 513949632
2023-03-06 08:49:46 -08:00
Weiyi Wang
2ba376283d [tfl] Add int16 / int8 support for builtin op floor_mod and floor_div
PiperOrigin-RevId: 513897126
2023-03-06 07:49:32 -08:00
Neel Kovelamudi
a43af0e27a Turn on v3 saving.
PiperOrigin-RevId: 513612802
2023-03-02 12:46:57 -08:00
Gabriel Rasskin
b59d2a159f Add warmup to CosineDecay learning rate schedule
PiperOrigin-RevId: 513348996
2023-03-01 14:55:21 -08:00
James Mullenbach
a5a1ced2e2 Create experimental API for retrieving worker index during parameter server training.
PiperOrigin-RevId: 513253825
2023-03-01 09:16:50 -08:00
Weiyi Wang
c96119e093 [tfl] Add i16 indice support for gather op
PiperOrigin-RevId: 513155532
2023-03-01 00:25:44 -08:00
Weiyi Wang
429ab55b2f [tfl] Add i16 support for less, greater_equal, equal
PiperOrigin-RevId: 513124583
2023-02-28 21:07:26 -08:00
Francois Chollet
947b3c6562 Remove sklearn Keras wrapper (long deprecated).
PiperOrigin-RevId: 512979563
2023-02-28 10:54:21 -08:00
Faizan Muhammad
b2fd8ca616 Add note about ConcreteFunction input validation
PiperOrigin-RevId: 512726039
2023-02-27 14:10:22 -08:00
TensorFlower Gardener
354d7ffcbf Merge pull request #52351 from johan-gras:upstream/mirrorpadint16
PiperOrigin-RevId: 511499235
2023-02-22 08:16:26 -08:00
Haoliang Zhang
24a08cef9f Add experimental_disable_delegate_clustering flag to python interpreter intializer.
PiperOrigin-RevId: 510605126
2023-02-17 23:15:48 -08:00
Divya S
5d5d858ff3 The SidecarEvalModelExport callback has been added to Keras as keras.utils. SidecarEvalModelExport . This callback allows for exporting the model that is deemed the "best" by the evaluator. The evaluator regularly evaluates the model and exports it if the user-defined comparison function determines that it is an improvement.
PiperOrigin-RevId: 509910874
2023-02-15 13:12:09 -08:00
Mihai Maruseac
cda579abde Fix release notes for future release.
Current release is busted, at least try to have the next one not fail in the same spectacular way.

PiperOrigin-RevId: 509806619
2023-02-15 05:45:45 -08:00
A. Unique TensorFlower
d3509a44ca [tf.data] Implement warm_start feature for all the asynchronous operations.
PiperOrigin-RevId: 509533594
2023-02-14 08:22:39 -08:00
A. Unique TensorFlower
7a616c7627 Introduce PyMetric as an experimental Keras API.
PiperOrigin-RevId: 508796638
2023-02-10 18:06:00 -08:00
A. Unique TensorFlower
c7f90c810f Introduce PyMetric as an experimental Keras API.
PiperOrigin-RevId: 508727909
2023-02-10 12:38:27 -08:00
A. Unique TensorFlower
08c9c1d88f Introduce PyMetric as an experimental Keras API.
PiperOrigin-RevId: 508696238
2023-02-10 10:36:35 -08:00
A. Unique TensorFlower
4574c4f53e Introduce PyMetric as an experimental Keras API.
PiperOrigin-RevId: 508409407
2023-02-09 10:28:59 -08:00
A. Unique TensorFlower
d9185d4f40 Introduce PyMetric as an experimental Keras API.
PiperOrigin-RevId: 508388440
2023-02-09 09:21:11 -08:00
Francois Chollet
e3df9f453e Add R2Score Keras metric.
PiperOrigin-RevId: 507813190
2023-02-07 10:07:12 -08:00
Francois Chollet
3717b469bc Add mish activation in Keras.
PiperOrigin-RevId: 507591019
2023-02-06 15:04:13 -08:00
Mihai Maruseac
888231f97a Fix release notes.
Becuase the automation that updates the release notes in master after branch cut for release happens has been destroyed and the step has not been done manually in time, we have commits such as 9fbf113704# and ba1372a41e that write the wrong contents to the release notes.

PiperOrigin-RevId: 507025073
2023-02-03 16:52:13 -08:00
Mihai Maruseac
5f570877a5 Update the TensorFlow RELEASE.md on master.
(We cut the branch for 2.12.0. Insert new blurb for new release notes TF 2.13.0)

PiperOrigin-RevId: 507021191
2023-02-03 16:34:14 -08:00
Vinila Settem
5449fd81a3 Update the TensorFlow RELEASE.md on master.
(We cut the branch for 2.12.0. Insert new blurb for new release notes TF 2.13.0)

PiperOrigin-RevId: 507017354
2023-02-03 16:14:04 -08:00
Francois Chollet
ba1372a41e Add Keras metrics FBetaScore and F1Score.
PiperOrigin-RevId: 507013486
2023-02-03 15:57:04 -08:00
Youchuan Hu
9fbf113704 Add float16 and float64 input&output type support for TFLite operator 'cast'
Type float16 and float64 input/output for TensorFlow 'cast' operator is used in some Federated Learning models, thus adding these type supports to TFLite 'cast' op can make these operators converted to TFLite build-in ops instead of flex ops.

PiperOrigin-RevId: 506997479
2023-02-03 14:43:56 -08:00
Faizan Muhammad
7afc4ac997 Add warning about assumed input_signatures
PiperOrigin-RevId: 506357398
2023-02-01 10:43:56 -08:00
Francois Chollet
acdcfe75b7 Minor touch up in release notes for 2.12.
PiperOrigin-RevId: 506185475
2023-01-31 19:46:17 -08:00
Francois Chollet
fc32cc8cdc Move ExportArchive to its own namespace.
PiperOrigin-RevId: 506022463
2023-01-31 09:19:49 -08:00
Francois Chollet
b1689de782 Create a keras.saving endpoint and add the ExportArchive class to the public API.
Note: there are enough saving-related utils that we should centralize them in their own namespace instead of overloading `utils`. Besides the `models` namespace is likely to be increasingly used for actual model instances (e.g. the SAM optimizer model...)
PiperOrigin-RevId: 505214178
2023-01-27 14:48:30 -08:00
Catherine Payne
8421f7a4fc Removing unused enum values for tfxla bridge flag from TF Public API
PiperOrigin-RevId: 504986360
2023-01-26 17:49:53 -08:00
TensorFlower Gardener
df9891474d Merge pull request #59436 from awsaf49:to_ordinal
PiperOrigin-RevId: 504940089
2023-01-26 14:33:19 -08:00
Awsaf
a5303845f1
Merge branch 'tensorflow:master' into to_ordinal 2023-01-26 01:27:12 +06:00
TensorFlower Gardener
36b98645a7 Merge pull request #59101 from trevor-m:tmorris-dtensor-reducescatter
PiperOrigin-RevId: 504415558
2023-01-24 17:18:21 -08:00
Austin Anderson
e8aa64c453 Remove --gpu package flags and make a note of their removal
PiperOrigin-RevId: 504378440
2023-01-24 14:43:34 -08:00
Awsaf
4b66075034
Update RELEASE.md for to_ordinal
For recently added `tf.keras.utils.to_ordinal` utility [here](https://github.com/keras-team/keras/pull/17419)
2023-01-25 02:43:04 +06:00
Reed Wanderman-Milne
267c63aa09 Add sync_devices function.
There was an RFC for this API: https://github.com/tensorflow/community/pull/434

PiperOrigin-RevId: 504062646
2023-01-23 13:15:50 -08:00
Francois Chollet
bd571052a0 Create public model.export() API.
PiperOrigin-RevId: 503561685
2023-01-20 18:19:48 -08:00
Scott Zhu
b5dc09f209 Add a util method to check if a tensor is a DTensor instance.
PiperOrigin-RevId: 503276072
2023-01-19 15:18:40 -08:00
A. Unique TensorFlower
19f3dd3b09 Add float16 and float64 input&output type support for TFLite operator 'cast'
Type float16 and float64 input/output for TensorFlow 'cast' operator is used in some Federated Learning models, thus adding these type supports to TFLite 'cast' op can make these operators converted to TFLite build-in ops instead of flex ops.

PiperOrigin-RevId: 502669256
2023-01-17 13:50:31 -08:00
Youchuan Hu
e0d0e494a1 Add float16 and float64 input&output type support for TFLite operator 'cast'
Type float16 and float64 input/output for TensorFlow 'cast' operator is used in some Federated Learning models, thus adding these type supports to TFLite 'cast' op can make these operators converted to TFLite build-in ops instead of flex ops.

PiperOrigin-RevId: 502638398
2023-01-17 11:19:48 -08:00
Monica Song
bff2e8dc75 [SavedModel Fingerprinting] Introduce public API tf.saved_model.experimental.read_fingerprint(export_dir) for reading a fingerprint given the file path (export_dir) of the SavedModel. Also, introduce new class tf.saved_model.experimental.Fingerprint which contains the fingerprint.
https://github.com/tensorflow/community/pull/415
https://github.com/tensorflow/community/pull/439

PiperOrigin-RevId: 501965978
2023-01-13 16:36:24 -08:00
John QiangZhang
ea3ddeefb0 Support TensorSpec input for experimental_get_compiler_ir
PiperOrigin-RevId: 501907754
2023-01-13 12:12:07 -08:00
Rick Chao
0587c57b3f Typo fix in RELEASE.md
PiperOrigin-RevId: 501390093
2023-01-11 15:19:54 -08:00
Faizan Muhammad
b4ffaeb696 Add input parameter sanitization announcement
PiperOrigin-RevId: 501341078
2023-01-11 11:59:02 -08:00
Alan Kelly
b0164f014f Add support for float Independently Recurrent LSTM (Indy LSTM).
The recurrent matrix is diagonal so this is much cheaper.

PiperOrigin-RevId: 500648644
2023-01-09 01:49:49 -08:00
Umer Javed
3f3f0aecc6 Create placeholders using FunctionType in TracingCompiler for tf.function.
PiperOrigin-RevId: 499675066
2023-01-04 20:07:58 -08:00
A. Unique TensorFlower
b7e5f42132 Create placeholders using FunctionType in TracingCompiler.
PiperOrigin-RevId: 499356761
2023-01-03 17:59:44 -08:00
Umer Javed
7db3792f5e Create placeholders using FunctionType in TracingCompiler.
PiperOrigin-RevId: 499337642
2023-01-03 16:10:35 -08:00
A. Unique TensorFlower
91baa03cb9 Merged commit includes the following changes:
496953709  by A. Unique TensorFlower<gardener@tensorflow.org>:
496952678  by A. Unique TensorFlower<gardener@tensorflow.org>:

    Fix iOS nightly release build. Add profiler.h in TensorFlowLiteC framework headers.

--
496952616  by A. Unique TensorFlower<gardener@tensorflow.org>:

    Convert _placeholder_value into a public API.

--
496949861  by A. Unique TensorFlower<gardener@tensorflow.org>:

    [XLA] Make HloModuleConfig own the string keys in `analysis_allowance_map_`

    This fixes a use-after-free bug when deserializing an HloModuleConfig:
    f1251be098/tensorflow/compiler/xla/service/hlo_module_config.cc (L304-L306)

    Without this change, the keys of `analysis_allowance_map_` have the
    same lifetime as the input proto that's being deserialized, which is
    probably very inconvenient semantics for the caller. In practice there
    are not many keys and they're short, so I don't think the extra string
    copy will have a noticeable performance impact.

--
496949804  by A. Unique TensorFlower<gardener@tensorflow.org>:

    Update the JAX's docker image to base it on the new image that TF has.

--
496947227  by A. Unique TensorFlower<gardener@tensorflow.org>:

    Remove unused imports.

--
496944423  by A. Unique TensorFlower<gardener@tensorflow.org>:

    Bypass nvprune if compiling with CUDA Clang. Retry

--
496941078  by A. Unique TensorFlower<gardener@tensorflow.org>:
496940772  by A. Unique TensorFlower<gardener@tensorflow.org>:

    Add `ParseFromString` method to `OpSharding` Python bindings.

--
496940632  by A. Unique TensorFlower<gardener@tensorflow.org>:

    Remove PAT from Scorecards workflow

    This should make the workflow work again. Will test after this lands.

    Signed-off-by: Mihai Maruseac <mihaimaruseac@google.com>

--
496939937  by A. Unique TensorFlower<gardener@tensorflow.org>:

    Automated visibility attribute cleanup.

--
496939490  by A. Unique TensorFlower<gardener@tensorflow.org>:

    Remove all PTX except for the specified one.

--
496931612  by A. Unique TensorFlower<gardener@tensorflow.org>:

    Integrate StableHLO at openxla/stablehlo@e8c1c04

--
496919498  by A. Unique TensorFlower<gardener@tensorflow.org>:

    [JITRT] Add a regression_test for broadcasting.

    This is a reduced version of broadcasting_2, which is much easier to
    read/debug.

--
496918085  by A. Unique TensorFlower<gardener@tensorflow.org>:

    Add RBE to linux builds to improve test times.

--
496914744  by A. Unique TensorFlower<gardener@tensorflow.org>:

    Add serialization support to FeatureSpace.

--
496911817  by A. Unique TensorFlower<gardener@tensorflow.org>:

    [IFRT] Remove BUILD file tests for IFRT, which is always enabled now.

--
496911684  by A. Unique TensorFlower<gardener@tensorflow.org>:

    [GmlSt] Implement `reifyResultShapes` for `gml_st.materialize`.

--
496906503  by A. Unique TensorFlower<gardener@tensorflow.org>:

    PR #58850: Update compat.py

    Imported from GitHub PR https://github.com/tensorflow/tensorflow/pull/58850

    Fixed the broken link of tf.compat.forward_compatible.
    Copybara import of the project:

    --
    458964893973f6aa7e1d59ab852587918f5a2ef4 by Tirumalesh <111861663+tiruk007@users.noreply.github.com>:

    Update compat.py

    Fixed the broken link of (tf.compat.forward_compatible)[https://www.tensorflow.org/api_docs/python/tf/compat/forward_compatible]

    Merging this change closes #58850

--
496904759  by A. Unique TensorFlower<gardener@tensorflow.org>:
496895256  by A. Unique TensorFlower<gardener@tensorflow.org>:

    [DelegatePerformance] Split the targets out into subpackages.

--
496893002  by A. Unique TensorFlower<gardener@tensorflow.org>:

    Remove unused `tf-jitrt-symbolic-shape-optimization` pass

--
496887677  by A. Unique TensorFlower<gardener@tensorflow.org>:

    [GmlSt] Tile map and fill ops again in a peeled loop for scalarization.

    The perfectly-tiled part of the loop remains unchanged and will be vectorized. Ops in the peeled loop should be scalarized later.

--
496885897  by A. Unique TensorFlower<gardener@tensorflow.org>:

    [MLIR:XLA] Move shape.bcast simplification into the MHLO's shape optimization pass

    Also, remove the old shape optimization pass from the pipeline.

--
496880934  by A. Unique TensorFlower<gardener@tensorflow.org>:

    [DelegatePerformance] Handle failures from parsing latency results.

--
496878266  by A. Unique TensorFlower<gardener@tensorflow.org>:

    Internal fixes.

--
496866713  by A. Unique TensorFlower<gardener@tensorflow.org>:

    Add failing tests for XlaCallModule.

    The newly added tests are failing at the moment and are disabled.
    Added here to help debugging.

--
496864860  by A. Unique TensorFlower<gardener@tensorflow.org>:

    [XLA:GPU] [NFC] Remove unused function

--
496859249  by A. Unique TensorFlower<gardener@tensorflow.org>:

    Cleaning up BUILD files to remove "loose" headers.

--

PiperOrigin-RevId: 496953709
2022-12-21 18:36:53 +00:00
Peng Wang
f361f1b71c Adds tf.nn.experimental.general_dropout which is similar to tf.random.experimental.stateless_dropout but accepts a custom sampler function, to be used in Keras' RandomGenerator, to avoid unnecessary seed generation and scrambling (i.e. a roundtrip from (key, counter) to seed and back) incurred by stateless_dropout.
PiperOrigin-RevId: 495937292
2022-12-16 12:40:36 -08:00
Jiri Simsa
76fa4c216e [tf.data] fix a typo in release notes
PiperOrigin-RevId: 495705022
2022-12-15 15:02:34 -08:00
Mihai Maruseac
6dab623109 Don't run mdformat when importing changes.
This has no significant effect on OSS, except adding one comment to the markdown file.

PiperOrigin-RevId: 495212616
2022-12-13 22:10:54 -08:00
David Dunleavy
2e1da6b4c1 Remove tensorflow/stream_executor. Users should use compiler/xla/stream_executor instead.
PiperOrigin-RevId: 495119859
2022-12-13 14:03:11 -08:00
Mateo Fidabel
9ea72f06c6 PR #17145: Adds show_trainable option to plot_model()
Imported from GitHub PR https://github.com/keras-team/keras/pull/17145

Fixes missing part of issue #15425 where `model.summary(show_trainable=True)` was implemented but `plot_model(model, show_trainable=True)` wasn't.

Also fixes a failing test case when having pydot & graphviz installed.
Copybara import of the project:

--
56de08b3048dac6398e6347eba3699fa560a0ba1 by Mateo Fidabel <mateofidabel@fpuna.edu.py>:

Added show_trainable to plot_model()

--
c6f8a64747b2c0812f7616eec36c4c91260f83c5 by Mateo Fidabel <mateofidabel@fpuna.edu.py>:

Fixed failing test case on vis_utils_test.py

Merging this change closes #17145

PiperOrigin-RevId: 494280644
2022-12-09 15:46:51 -08:00
Francois Chollet
b29fb89b70 Add Identity layer.
PiperOrigin-RevId: 493649388
2022-12-07 10:51:51 -08:00
Francois Chollet
700c211825 Mention new Keras file format in the release notes.
PiperOrigin-RevId: 493404869
2022-12-06 14:02:51 -08:00
Mark Daoust
6543868155 Fix masked losses.
Masked losses with the default "auto" reduction were giving outputs that are
inconsistent with what you would get from a ragged input. Masked and Ragged are two different representations of the same thing (when it can be represented as ragged).  These should match.

The (input_type='masked', reduction='auto') case fails (doesn't match the ragged case) before this change.

The existing tests, where I'm changing the expected values are because I believe the old values are incorrect.

PiperOrigin-RevId: 493003876
2022-12-05 07:44:51 -08:00
A. Unique TensorFlower
ee3c46dc30 Rollback of PR #17291
PiperOrigin-RevId: 492873391
2022-12-04 17:25:10 -08:00
Aditya Kane
388759567d PR #17291: Added identity layer
Imported from GitHub PR https://github.com/keras-team/keras/pull/17291

@fchollet

Please see #17251.
Copybara import of the project:

--
356eaa8a7b035dcac2a565f9dde38201334f1c0c by Aditya Kane <64411306+AdityaKane2001@users.noreply.github.com>:

Added identity layer
--
b8240ece60fced29c0e47970219c064bed18ae83 by Aditya Kane <adityakane1@gmail.com>:

added identity to core import

Merging this change closes #17291

PiperOrigin-RevId: 492867838
2022-12-04 16:25:33 -08:00
A. Unique TensorFlower
6430797f32 Added extension_type.asdict() that converts an ExtensionType instance to a dict.
The function is an ExtensionType equivalent of dataclasses.asdict() or
namedtuple._asdict().

PiperOrigin-RevId: 491673963
2022-11-29 10:25:44 -08:00
A. Unique TensorFlower
5c27c071d5 Add rerandomize_each_iteration option to sample_from_datasets. This option controls behavior of seeded sequence of random numbers used for sampling. If set to True, the same deterministic random number sequence is generated every epoch. If set to False, a different deterministic sequence of random numbers is generated every epoch.
PiperOrigin-RevId: 491454310
2022-11-28 15:10:39 -08:00
A. Unique TensorFlower
ab123a4be6 Correct comments about the default behavior for random(). The default behavior is not re-randomizing for each epoch.
PiperOrigin-RevId: 491439277
2022-11-28 14:15:02 -08:00
Mark Daoust
f5d8307cd8 Lets not add tf.math.segment_sum_v2 to the public api.
PiperOrigin-RevId: 491400916
2022-11-28 11:49:44 -08:00
Ken Franko
c4f911ce31 Remove tf.config.experimental.enable_mlir_graph_optimization and tf.config.experimental.enable_mlir_graph_optimization API.
PiperOrigin-RevId: 489482150
2022-11-18 08:39:15 -08:00
Vinila Settem
aaf9a8c236 Merge release notes for the latest TF 2.11 final releases.
PiperOrigin-RevId: 489386887
2022-11-17 22:17:15 -08:00
Smit Hinsu
b9862801b8 Introduce SegmentSumV2 op taking num_segments as an input
Also, define XlaOpKernel for this op leveraging the existing implementation but propagate indices_are_sorted to HLO Scatter op.

Having the num_segments as an input makes the output type bounded and can be supported in XLA.

PiperOrigin-RevId: 489096541
2022-11-16 19:18:32 -08:00
Wilsin Gosti
562e13f701 #tf-data Implement a new rerandomize_each_iteration argument to random() to control behavior of seeded sequence of random numbers. If set to True, the same deterministic random number sequence is generated every epoch. If set to False, a different deterministic sequence of random numbers is generated every epoch.
PiperOrigin-RevId: 488967486
2022-11-16 10:05:24 -08:00
Mark Daoust
a477baef19 Move stateless_split out of experimental.
PiperOrigin-RevId: 488632446
2022-11-15 05:43:40 -08:00
Jiri Simsa
b0b081efd6 [tf.data] Implementation of alternative checkpoint protocol, which makes it possible to represent the state of an input pipeline without having to store the contents of internal buffers. The alternative checkpointing logic can be enabled through the experimental_symbolic_checkpoint option of tf.data.Options(). Note that only a subset of tf.data operations supports the new checkpointing protocol.
PiperOrigin-RevId: 488559450
2022-11-14 22:35:44 -08:00
Mihai Maruseac
a0d9e7f9a2 Revert invalid relnotes update
PiperOrigin-RevId: 487919934
2022-11-11 14:43:02 -08:00
Laura Pak
7d2e78aa8b Add giflib 5.2.1 notice and security CVEs to release notes.
PiperOrigin-RevId: 487910565
2022-11-11 14:08:16 -08:00
Faizan Muhammad
b489a26070 Add a notice for inspect migration
PiperOrigin-RevId: 487571300
2022-11-10 10:18:47 -08:00
Francois Chollet
4cc70f4415 Add FeatureSpace utility.
PiperOrigin-RevId: 487344904
2022-11-09 14:21:59 -08:00
Ramesh Sampath
8b32d8f680 Removing duplicate section of tf.keras in release doc
PiperOrigin-RevId: 487311963
2022-11-09 12:18:37 -08:00
Jean-Baptiste Lespiau
6a7f86b786 Remove tsl::Status::OK (use OkStatus() or the backward compatible Status() instead).
PiperOrigin-RevId: 486610576
2022-11-07 03:00:22 -08:00
A. Unique TensorFlower
e79470ad50 Rollout Coordination Service to DTensor.
Enable Coordination service by default.

PiperOrigin-RevId: 485902629
2022-11-03 10:07:37 -07:00
A. Unique TensorFlower
f433b9e1df Implement support for masking to BatchNormalization layer
PiperOrigin-RevId: 485316240
2022-11-01 07:52:20 -07:00
Matt Callanan
29e6955939 Graduate tf.data.experimental.dense_to_sparse_batch to tf.data.Dataset.sparse_batch.
PiperOrigin-RevId: 485168714
2022-10-31 15:56:32 -07:00
Quentin Khan
c82a24bcfe Make MLIR compiler generate 6D transpose.
PiperOrigin-RevId: 485077208
2022-10-31 09:57:54 -07:00
A. Unique TensorFlower
36952899bd Merge SyncBatchNormalization into BatchNormalization with parameter synchronized
PiperOrigin-RevId: 484365355
2022-10-27 15:41:20 -07:00
A. Unique TensorFlower
2bd5bd91cd Added sparse tensor input support for tf.keras.layers.Embedding
PiperOrigin-RevId: 484049758
2022-10-26 13:14:09 -07:00
Haoliang Zhang
332e276291 Add fp16 support for tflite fill op.
PiperOrigin-RevId: 484013046
2022-10-26 11:03:22 -07:00
Gabriel Rasskin
fbfc33be7d Make jit_compile a settable property.
Similar to run_eagerly, jit_compile is now settable outside of compile().

PiperOrigin-RevId: 483762815
2022-10-25 13:39:33 -07:00
A. Unique TensorFlower
0d75da0288 Merge SyncBatchNormalization into BatchNormalization with parameter use_sync
PiperOrigin-RevId: 482933808
2022-10-21 18:23:19 -07:00
A. Unique TensorFlower
ba3d3d80ea Merge SyncBatchNormalization into BatchNormalization with parameter use_sync
PiperOrigin-RevId: 482921013
2022-10-21 17:08:29 -07:00
Chen Qian
cbb1aeabdf Include the PSS performance issue of the new optimizer in the release note.
PiperOrigin-RevId: 482833072
2022-10-21 10:48:25 -07:00
Matt Callanan
6beecdaf55 Graduate tf.data.experimental.dense_to_ragged_batch to tf.data.Dataset.ragged_batch.
PiperOrigin-RevId: 482614367
2022-10-20 15:37:20 -07:00
Michael Chinen
08867a9f5e keras: fix typo in keras optimizers migration recommendation
tf.keras.optimizer.legacy -> tf.keras.optimizers.legacy

PiperOrigin-RevId: 481720094
2022-10-17 13:16:13 -07:00
Vinila Settem
c755d03913 We cut the branch for 2.11.0. Insert new blurb for new release notes TF 2.12.0.
PiperOrigin-RevId: 481667092
2022-10-17 09:59:46 -07:00
Jean-Baptiste Lespiau
aa63c6d92d Remove ValueOrDie from tsl::StatusOr.
PiperOrigin-RevId: 481620317
2022-10-17 06:13:09 -07:00
Monica Song
9b13895146 [SavedModel Fingerprinting] Add description of SavedModel fingerprinting to 2.11 release notes.
https://github.com/tensorflow/community/pull/415

PiperOrigin-RevId: 479438713
2022-10-06 16:23:12 -07:00
Faizan Muhammad
a549623567 Deprecate experimental_follow_type_hints for tf.function
PiperOrigin-RevId: 479350246
2022-10-06 10:56:49 -07:00
Fabien Hertschuh
8056627d6a Added SparseTensor.set_shape to update the static dense shape of a sparse tensor.
`sparse_reorder` now preserves the static rank and statically known dimensions of the tensor.

Previously, `sparse_reorder` would only keep the static rank and dimensions if the static shape was fully defined, and would otherwise make the shape fully dynamic. There is however value in keeping a static rank and know static dimensions even if the shape is not fully defined. One common use case is when the batch size is not known but other dimensions are fully defined.

PiperOrigin-RevId: 479108317
2022-10-05 12:11:01 -07:00
A. Unique TensorFlower
f7ca3f1df4 Added warmstart_embedding_matrix to tf.keras.utils
PiperOrigin-RevId: 478299677
2022-10-02 01:35:57 -07:00
Chen Qian
1e03510a69 Add release note for Keras optimizer change.
PiperOrigin-RevId: 477322187
2022-09-27 18:11:23 -07:00
Edward Schwartz
eb6c16a9a4 Add "device placement for datasets with string ragged tensors" to RELEASE.md
See https://github.com/tensorflow/tensorflow/issues/50507

PiperOrigin-RevId: 477279680
2022-09-27 14:53:55 -07:00
Peng Wang
a8b9e01241 Added a new constructor argument experimental_enable_variable_lifting to tf.Variable, defaulting to True. When it's False, the variable won't be lifted out of tf.function, thus it can be used as a tf.function-local variable: during each execution of the tf.function, the variable will be created and then disposed, similar to a local (i.e. stack-allocated) variable in C/C++.
Currently `experimental_enable_variable_lifting=False` only works on non-XLA devices (e.g. under `@tf.function(jit_compile=False)`).

PiperOrigin-RevId: 477033035
2022-09-26 17:44:56 -07:00
A. Unique TensorFlower
4499592a67 Introduce GroupNormalization to the Keras API.
PiperOrigin-RevId: 476968284
2022-09-26 12:59:06 -07:00
Jun Xu
77408c883b Make ResourceVariable a subclass of CompositeTensor.
By doing so, we will be able to nest ResourceVariables in ExtensionType/CompositeTensor. It will also clear our way to return ResourceVariables from tf.function and pass variable through control flow.

Note, with this CL, tf.nest with expand_composites=True will not expand resource variables into dt_resource tensors. That will be done in a following CL to reduce the chance of being rolled back for this CL.

`CompositeTensor` is added to baseclasses of `tf.experimental.dtensor.DVariable` because it is a subclass of ResourceVariable.

PiperOrigin-RevId: 476416307
2022-09-23 11:21:48 -07:00
A. Unique TensorFlower
fefb50fb98 Expose Model get_metrics_result on Keras Model as a public API
PiperOrigin-RevId: 475681912
2022-09-20 16:36:07 -07:00
TensorFlower Gardener
07d731086c Merge pull request #57727 from tensorflow:lint-tf2.10-release
PiperOrigin-RevId: 475633908
2022-09-20 13:18:42 -07:00
A. Unique TensorFlower
be53a800b7 Labeling StructuredTensor experimental.
PiperOrigin-RevId: 475606020
2022-09-20 11:32:37 -07:00
8bitmp3
9b10cefa3e
Lint TensorFlow 2.10 release notes 2022-09-16 20:13:30 +01:00
A. Unique TensorFlower
2bacd005c5 [tf.data] Expose rebatch as a public API.
PiperOrigin-RevId: 473409011
2022-09-09 21:50:44 -07:00
Matt Callanan
796ee14770 Graduate tf.data.experimental.ignore_errors to tf.data.Dataset.ignore_errors.
PiperOrigin-RevId: 473093537
2022-09-08 15:05:16 -07:00
A. Unique TensorFlower
25449cfe85 Unify dtensor accelerator initialization to a single API.
dtensor.initialize_accelerator_systems():
 - Reinitialization only allowed after shutdown_accelerator_system() is called.
 - Replaces initialize_tpu_system() and initialize_multi_client().

dtensor.shutdown_accelerator_systems():
 - Only supported in single-controller mode due to TF distributed runtime limitation.
 - replaces shutdown_tpu_system()

Clarify definition of
- single-controller: job_name == localhost, num_clients == 1,
and
- multi-client: job_name != localhost, arbitrary num_clients.

PiperOrigin-RevId: 473017056
2022-09-08 10:05:50 -07:00
A. Unique TensorFlower
ab47cfa6ca Internal change
PiperOrigin-RevId: 472863249
2022-09-07 18:32:30 -07:00
A. Unique TensorFlower
64edd7786e Unify dtensor accelerator initialization to a single API.
dtensor.initialize_accelerator_systems():
 - Reinitialization only allowed after shutdown_accelerator_system() is called.
 - Replaces initialize_tpu_system() and initialize_multi_client().

dtensor.shutdown_accelerator_systems():
 - Only supported in single-controller mode due to TF distributed runtime limitation.
 - replaces shutdown_tpu_system()

Clarify definition of
- single-controller: job_name == localhost, num_clients == 1,
and
- multi-client: job_name != localhost, arbitrary num_clients.

PiperOrigin-RevId: 472848152
2022-09-07 16:58:44 -07:00
Vinila Settem
78d535ee13 Merge release notes for the latest TF 2.10 final releases.
PiperOrigin-RevId: 472552698
2022-09-06 14:12:03 -07:00
A. Unique TensorFlower
d6cc0792d0 Internal change
PiperOrigin-RevId: 471889101
2022-09-02 14:44:59 -07:00
A. Unique TensorFlower
d8659073bd Unify dtensor accelerator initialization to a single API.
dtensor.initialize_accelerator_systems():
 - Reinitialization only allowed after shutdown_accelerator_system() is called.
 - Replaces initialize_tpu_system() and initialize_multi_client().

dtensor.shutdown_accelerator_systems():
 - Only supported in single-controller mode due to TF distributed runtime limitation.
 - replaces shutdown_tpu_system()

Clarify definition of
- single-controller: job_name == localhost, num_clients == 1,
and
- multi-client: job_name != localhost, arbitrary num_clients.

PiperOrigin-RevId: 471879090
2022-09-02 13:58:03 -07:00
Grant Jensen
09505c0661 [lite] Added mlir implementation of sign
PiperOrigin-RevId: 471389627
2022-08-31 16:53:45 -07:00
Matt Callanan
6a5c94b82e Graduate tf.data.experimental.Counter to tf.data.Dataset.counter.
PiperOrigin-RevId: 470721700
2022-08-29 08:15:08 -07:00
A. Unique TensorFlower
37ea9adc47 Making StructuredTensor experimental.
PiperOrigin-RevId: 470069145
2022-08-25 13:32:00 -07:00
A. Unique TensorFlower
0b62f586d2 Making StructuredTensor experimental.
PiperOrigin-RevId: 469725053
2022-08-24 07:51:55 -07:00
Jun Xu
af1889233e Add custom_gradient support to CompositeTensors.
PiperOrigin-RevId: 469584004
2022-08-23 16:29:44 -07:00
A. Unique TensorFlower
c39f4f1c63 Add logic in data.experimental.make_batched_features_dataset to skip the list_files operation when the input is a list of files.
PiperOrigin-RevId: 469429916
2022-08-23 05:22:26 -07:00
A. Unique TensorFlower
3c39c6fe29 Add logic in data.experimental.make_batched_features_dataset to skip the list_files operation when the input is a list of files.
PiperOrigin-RevId: 469425263
2022-08-23 04:52:41 -07:00
Chuan He
2d13fc51f7 Adds support in tflite fbs importer/exporter to better support tf_type.variant type.
PiperOrigin-RevId: 468010936
2022-08-16 13:36:14 -07:00
Jean-Baptiste Lespiau
e7904a5eaf Rollback of 467232056
PiperOrigin-RevId: 467863253
2022-08-16 01:22:59 -07:00
TensorFlower Gardener
edad11233b Merge pull request #56771 from CohenAriel:add-ssim-index-map-option
PiperOrigin-RevId: 467465476
2022-08-13 20:22:14 -07:00
A. Unique TensorFlower
d57074c781 Remove tensorflow::StatusOr::ConsumeValueOrDie.
This function was deprecated with a Clang annotation for the 2.10 TF release. We are deleting it for 2.11.

PiperOrigin-RevId: 467258243
2022-08-12 11:46:11 -07:00
Jean-Baptiste Lespiau
e5aaaab33e Remove tensorflow::StatusOr::ConsumeValueOrDie.
This function was deprecated with a Clang annotation for the 2.10 TF release. We are deleting it for 2.11.

PiperOrigin-RevId: 467232056
2022-08-12 10:00:08 -07:00
CohenAriel
a2ed40181e Add return_index_map argument in ssim() 2022-08-12 01:29:02 +03:00
Grant Jensen
9ffb691278 [lite] Added mlir implementation of atan2
PiperOrigin-RevId: 467015651
2022-08-11 12:10:57 -07:00
A. Unique TensorFlower
3304cb18bc Adds support in tflite fbs importer/exporter to better support tf_type.variant type.
PiperOrigin-RevId: 466931687
2022-08-11 05:57:29 -07:00
Chuan He
091e1e974f Adds support in tflite fbs importer/exporter to better support tf_type.variant type.
PiperOrigin-RevId: 466797440
2022-08-10 15:19:04 -07:00
Eric Yang
7af5788047 Support TFLite UnsortedSegmentMin op (float32 only, converter changes)
PiperOrigin-RevId: 466428758
2022-08-09 12:10:26 -07:00
Grant Jensen
475b3f3ab8 [lite] Support complex64 for mul op.
PiperOrigin-RevId: 466411967
2022-08-09 11:17:19 -07:00
Vinila Settem
b047c64770 Edit release notes for TF 2.10.0 (Line Wrap)
PiperOrigin-RevId: 465310400
2022-08-04 07:40:21 -07:00
Yaning Liang
b87984af9a Export CheckpointView to the public API.
PiperOrigin-RevId: 464889518
2022-08-02 14:39:58 -07:00
Vinila Settem
ef946895f1 Insert new blurb for new release notes.
We cut the branch for 2.10, now we add release notes for 2.11.0

PiperOrigin-RevId: 463948784
2022-07-28 16:09:17 -07:00
Chen Qian
fa26a8ebfb Add to release note that experimental optimizer will graduate in 2.11.
PiperOrigin-RevId: 463670180
2022-07-27 13:58:13 -07:00
Yaning Liang
f1656e7642 Export TrackableView to the public API.
PiperOrigin-RevId: 463620038
2022-07-27 10:27:47 -07:00
Yang Chen
76aeaa7b99 #tf-data-service register_dataset accepts a dataset_id.
If provided, tf.data service will use the provided ID for the dataset.
If the dataset ID already exists, no new dataset will be registered.
This is useful if multiple training jobs need to use the same dataset
for training. In this case, users should call `register_dataset` with
the same `dataset_id`.

PiperOrigin-RevId: 462690057
2022-07-22 13:26:35 -07:00
Luke Boyer
59f1c50bf2 Support TFLite UnsortedSegmentSum Op (converter changes)
PiperOrigin-RevId: 462472445
2022-07-21 14:39:03 -07:00
Lucas David
960f707b13 PR #16712: Add ignore_class to sparse crossentropy and IoU
Imported from GitHub PR https://github.com/keras-team/keras/pull/16712

Properly fixes #6118 and #5911.

#### Summary
* Add the `ignore_index: Optional[int]` parameter to the following functions/constructors:
  - `backend.sparse_categorical_crossentropy`
  - `lossses.sparse_categorical_crossentropy`
  - `metrics.SparseCategoricalCrossentropy`
  - `metrics._IoUBase`
  - `metrics.IoU`
  - `metrics.MeanIoU`
  - `metrics.OneHotIoU`
  - `metrics.OneHotMeanIoU`
* Add `sparse_labels: bool` and `sparse_preds: bool` parameters in `_IoUBase`, `IoU`, `MeanIoU` metric classes.
* Add `sparse_preds:bool` to the `OneHotIoU` and `OneHotMeanIoU` metric classes.
* Refactor: A replicated code section shared among `backend.categorical_crossentropy`, `backend.sparse_categorical_crossentropy`, and `backend.binary_crossentropy` into a single function named `_get_logits`.

#### Goals
1. **ignore_index**: In segmentation problems, some pixels in segmentation maps might not represent valid categorical labels. Examples:
   - object boundaries are marked with void category, as the annotators disagree on which label to attribute
   - small maps are padded with the *void* class to conform with the sizes of larger ones after `Dataset#padded_batch`
   - specific objects out of the context of the problem, such as the hood of a car being captured by a static camera
   - pseudo-labels (originated from weakly supervised strategies) might contain pixels/regions where label is uncertain

   It's common to attribute the label `-1` or `255` and ignore these pixels during training. This PR implements this feature by masking the target and the output signals, only computing the metrics over the valid pixels. Moreover, it mirrors PyTorch's [CrossEntropyLoss(ignore_index=-100)](https://pytorch.org/docs/stable/generated/torch.nn.CrossEntropyLoss.html).

2. **sparse_preds**: `IoU` and `MeanIoU` assumes both `target` and `output` are sparse signals, where categories are represented as natural integers. Conversely, `OneHotIoU` and `OneHotMeanIoU` assume both are probability distribution vectors. This is far from what I believe to be the most obvious case: sparse segmentation labels and dense output vectors:
   ```py
   >>> classes = 20
   >>> model = Sequential([
   >>>    ResNet50V2(input_shape=[512, 512, 3], include_top=False, pooling=None, weights=None),
   >>>    Conv2D(classes, kernel_size=1, activation='softmax', name='predictions')
   >>> ])
   >>> print(model.output.shape)
   (None, 16, 16, 20)
   ```

   So now IoU can be easily used as this:
   ```py
   model.compile(opt='sgd', loss='sparse_categorical_crossentropy', metrics=[
     MeanIoU(classes, sparse_preds=False, ignore_index=-1)
   ])
   ```

#### Limitations
Currently, `backend.sparse_categorical_crossentropy` only reduces the dimension containing the logits, and the result is reshaped into the original output shape (except for the last axis) if the information is available.
However, when a pixel is not valid, its associated cross-entropy value is not available and reshape cannot occur without creating a ragged tensor. Therefore, when `ignore_index is not None` (and only then), I opted to sum all cross-entropy values over the axes `range(1, output_rank-1)` and divide by the number of valid pixels (similar to what pytorch does). In this case, the output tensor will have `shape=[output_shape[0]]=[batch_size]`.

An alternative would be to return a flatten array containing only valid entries, though the batch information would be lost and the user would have difficulties if they had per-sample operations being applied to these loss values.
Copybara import of the project:

--
b7f02816b5320855ae528971766fdcaad7134a9b by lucasdavid <lucasolivdavid@gmail.com>:

Add ignore_index crossentropy and IoU

--
1589a843bac4390c8377db05cbd6ae650b6210cc by lucasdavid <lucasolivdavid@gmail.com>:

Remove duplicate convert_to_tensor

--
70f7fb6789e1a7e030737a46847b24b892965e4e by lucasdavid <lucasolivdavid@gmail.com>:

Rename ignore_index to ignore_label, update docs

--
db9f76ac8d1945630061582b03381939349bb59a by lucasdavid <lucasolivdavid@gmail.com>:

Implement masked loss reduction

--
4f1308112f4188c4e14fdf3a59af8fe5f30db61f by lucasdavid <lucasolivdavid@gmail.com>:

Update docs

Merging this change closes #16712

PiperOrigin-RevId: 461661376
2022-07-18 11:00:16 -07:00
A. Unique TensorFlower
058696ea19 Add scatter_nd I1 support to the release list.
PiperOrigin-RevId: 460990228
2022-07-14 10:10:58 -07:00
A. Unique TensorFlower
12f38bba66 lite: Add unsorted_segment_max op support
converter change

PiperOrigin-RevId: 460747356
2022-07-13 10:26:24 -07:00
Matt Callanan
92ec7bc771 Add experimental from_list() tf.data API.
PiperOrigin-RevId: 460473802
2022-07-12 08:55:07 -07:00
Aurélien Geron
f2a40a56eb PR #16619: Add support for Keras mask & causal mask to MultiHeadAttention
This is a first go at adding Keras masking support and causal support to the `MultiHeadAttention` layer.

See the discussion in [#16248](https://github.com/keras-team/keras/issues/16248).

Imported from GitHub PR https://github.com/tensorflow/tensorflow/pull/16619

Copybara import of the project:

  - c0293ded9abe8ac7719cceb0095fa9dff807d2fe Add support for Keras masking and causal masking by Aurélien Geron <ageron@users.noreply.github.com>
  - 015625fb981212a97c282b71a0479b6e7cada6b3 Replace causal in init with use_causal_mask in call by Aurélien Geron <ageron@users.noreply.github.com>
  - ebf46bf42166a36068017d12d999d0ecd6e55d69 Reformat code using shell/format.sh by Aurélien Geron <ageron@users.noreply.github.com>
  - 9ec97ba141354c8b34b7735942ffb207766b2d96 Fix docstring indentation and missing line breaks by Aurélien Geron <ageron@users.noreply.github.com>
  - b00b4b462d74d3f3a387a07550945c1d19e6ebe2 Merge branch 'master' into mha_automask by Aurélien Geron <ageron@users.noreply.github.com>
  - 76055673c562571c088f80184c70034221a6ee7e Add defensive casting to bool for implicit and explicit m... by Aurélien Geron <ageron@users.noreply.github.com>
  - 1f724936ce4753fd83d4cdb7bec03b49b3def98f Merge 76055673c562571c088f80184c70034221a6ee7e into e1d39... by Aurélien Geron <ageron@users.noreply.github.com>

PiperOrigin-RevId: 460320823
2022-07-11 16:03:44 -07:00
A. Unique TensorFlower
359277d35e Standardize on use_causal_mask in call() and mark causal argument in constructor as deprecated.
Also remove testing of causal masks from `layer_correctness` since not needed and changing arguments in call doesn't fit easily into this test fixture.

PiperOrigin-RevId: 459791640
2022-07-08 10:59:27 -07:00
Rick Chao
7b7efd3f24 Typo fix in release notes.
PiperOrigin-RevId: 457586782
2022-06-27 16:04:58 -07:00
Scott Zhu
895f9bdea5 Add AdamW optimizer for Keras Dtensor name space.
AdamW is widely used as the default optimizer for Bert related tasks.

PiperOrigin-RevId: 457519157
2022-06-27 11:00:29 -07:00
Wilsin Gosti
cb56bd8ebd [tf.data] Implement a new tf.data Autotune stage-based algorithm based on stage-based analysis. This requires some refactoring of the stage-based timing analysis code.
PiperOrigin-RevId: 457085290
2022-06-24 13:46:29 -07:00
Xinyi Wang
611cb4ed1e Add release note for tf.distribute.experimental.PreemptionCheckpointHandler.
PiperOrigin-RevId: 455649431
2022-06-17 10:47:00 -07:00
Jean-Baptiste Lespiau
680b97d935 Inform users about the future change regarding tensorflow::Status.
PiperOrigin-RevId: 454789739
2022-06-14 00:44:13 -07:00
TensorFlower Gardener
0a5d75016c Merge pull request #56209 from Djacon:patch-1
PiperOrigin-RevId: 454602724
2022-06-13 07:25:33 -07:00
Terry Heo
625a4045bc lite: Switch to Flatbuffer 2.0.5
Update TFLite build rules to use Flatbuffer v2.0.5
Also following changes are made:
- Updated schema_generated.h for 2.0.5.
- Fix a regression in flatbuffer_export.cc
- Update tensor comparison logic in quantize_model_test.cc

PiperOrigin-RevId: 454483837
2022-06-12 13:49:42 -07:00
A. Unique TensorFlower
6c6fe3d2f5 Add flag controlling logical to physical device assignment.
A new argument experimental_device_ordinal is added to LogicalDeviceConfiguration,
and plumbed to gpu_device.cc. The logical devices created will be ordered by
(device_ordinal, location in the flattened logical device configuration list).

If device_ordinal is 0 (default), then we get the current behavior where all logical devices of the same physical devices receive nearby tf device ids.
If device_ordinal is incremental per config-group for a physical device, then we can round-robin the logical devices.

This works around the limitation where logical to physical association cannot be changed after established during the process life time. The error is raised from TfToPlatformDeviceIdMap::Insert, which is a per process singleton, but there may be additional constraints.

DTensor 2GPU unit tests (not OSS yet) trigger this, and the tests pass after this fix.

PiperOrigin-RevId: 454191314
2022-06-10 10:24:50 -07:00
Scott Zhu
23d4b96cc7 Update keras initializer to be fully stateless.
There will be a behavior change after this cl.
1. Unseeded initializer will always generate same value after creation.
2. Unseeded initializer will raise a warning if it is reused (called) multiple times. This is to avoid reuse the instance for multiple variables, which could generate same value when shapes are the same.
3. Seeded initializer will always generate same value after creation, instead of determinist sequence.

PiperOrigin-RevId: 453967472
2022-06-09 11:20:41 -07:00
A. Unique TensorFlower
d222f4a525 Add step granularity for BackupAndRestore
PiperOrigin-RevId: 452124032
2022-05-31 13:28:44 -07:00
George Karpenkov
edb19a71c7 Implement compiled MWMS with XLA on GPU.
Required a new runner with _noshare combination, and a test in Keras for full
coverage.

PiperOrigin-RevId: 452006969
2022-05-31 03:50:33 -07:00
Wilsin Gosti
7ef45a67ad [tf.data] Introduce a new optimization option: inject_prefetch, which is off by default.
PiperOrigin-RevId: 451223879
2022-05-26 12:57:01 -07:00
Mihai Maruseac
91fefeb8eb Add release notes for TF 2.9.1
PiperOrigin-RevId: 450706529
2022-05-24 10:00:19 -07:00
Mihai Maruseac
4931b58aca Add release notes for TF 2.8.2
PiperOrigin-RevId: 450703031
2022-05-24 09:48:18 -07:00
Mihai Maruseac
4be6db1f17 Add release notes for TF 2.7.3
PiperOrigin-RevId: 450701622
2022-05-24 09:40:59 -07:00