1. 01 7月, 2021 1 次提交
  2. 25 6月, 2021 8 次提交
  3. 24 6月, 2021 9 次提交
  4. 23 6月, 2021 18 次提交
  5. 22 6月, 2021 4 次提交
    • F
      Add prefetching to datasets generated via Keras utility functions. · 72c161e3
      Francois Chollet 提交于
      PiperOrigin-RevId: 380652823
      72c161e3
    • Z
      PR #49292: Update metrics.py: Fix SparseCategoricalAccuracy.update_state() doc string · 4244fba0
      Zirui Zhuang 提交于
      Imported from GitHub PR https://github.com/tensorflow/tensorflow/pull/49292
      
      Update metrics.py: Fix SparseCategoricalAccuracy.update_state() doc string
      
      Try fixing issue #49252
      
      For SparseCategoricalAccuracy, `y_true` should be integer labels and `y_pred` should be probabilities.
      
      ```
          m = tf.keras.metrics.SparseCategoricalAccuracy()
      
          m.update_state([[2], [1]], [[0.1, 0.6, 0.3], [0.05, 0.95, 0]])  # Correct usage,  `y_true` as integer labels and `y_pred` as probabilities.
          print(m.result().numpy())
          # >>> 0.5
      
          m.update_state([[2], [1]], [[1], [1]])  # Wrong usage, both as integer labels.
          print(m.result().numpy())
          # >>> 0.25
      
          m.update_state([[0, 1, 0], [0, 1, 0]], [[0.1, 0.6, 0.3], [0.05, 0.95, 0]])  # Wrong usage, both as probabilities.
          print(m.result().numpy())
          # >>> Error
      ```
      Copybara import of the project:
      
      --
      d6ee4a941b79a464a9b229f6a22be50baab62d4d by Zirui Zhuang <zr.zz.alp@gmail.com>:
      
      Update metrics.py
      
      Fix SparseCategoricalAccuracy.update_state() doc string
      
      --
      9410d39d0a9f850c4fb615a1d8b607f1b75d80c3 by Zirui Zhuang <zr.zz.alp@gmail.com>:
      
      Update tensorflow/python/keras/metrics.py
      
      correction on the description of y_true
      --
      57dbe0fd01d3d4548f3453013177e49073edb463 by Zirui Zhuang <zr.zz.alp@gmail.com>:
      
      Update tensorflow/python/keras/metrics.py
      
      explicitly return
      --
      8d83bffd4776bbfad12a4e2669e8e30f7a26d3a7 by Zirui Zhuang <zr.zz.alp@gmail.com>:
      
      Update tensorflow/python/keras/metrics.py
      
      correction on dimension annotation
      --
      d064d6e41d2f3fad390e82eea6b4edc6b9c46558 by Zirui Zhuang <zr.zz.alp@gmail.com>:
      
      Update metrics.py
      
      reuse update_state docstring by using inheritance
      
      --
      2b7f4d924251a67a65953b1f83a0499986ee1475 by Zirui Zhuang <zr.zz.alp@gmail.com>:
      
      Revert "Update metrics.py"
      
      This reverts commit d064d6e41d2f3fad390e82eea6b4edc6b9c46558.
      
      --
      7e718e6538e72d125bc5edc857c15fc2053877a2 by Zirui Zhuang <zr.zz.alp@gmail.com>:
      
      Update metrics.py
      
      using private string UPDATE_STATE_DOCSTRING
      
      PiperOrigin-RevId: 380647901
      4244fba0
    • Y
      Re-enable broken hashing tests. · 8351b87a
      Yash Katariya 提交于
      PiperOrigin-RevId: 380646732
      8351b87a
    • M
      Port keras lookup layers to new adapt, use a StaticHashTable during call · fe31a34a
      Matt Watson 提交于
      This is a significant refactor of the internals of the layer, which will break
      SavedModel compatibility with previous versions. The usage of the layer will
      remain the same, so a compatible layer should be generatable from the same
      training script.
      
      This refactor has the following advantages:
       - Static tables can be distributed to end workers in a multi-worker setting
         allowing more efficient distributed training.
       - File based vocabularies will only be scanned once.
       - Static vocabularies passed on init will be consistently clonable with the
         layer config, rather than clonable only in the file based case.
      
      We now consistently enforce that a vocabulary must be set when calling the
      layer on anything besides a keras.Input.
      
      PiperOrigin-RevId: 380645230
      fe31a34a