tf-models-nightly 2.19.0.dev20241213__py2.py3-none-any.whl → 2.19.0.dev20241214__py2.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.
@@ -16,7 +16,6 @@
16
16
  # pylint: disable=g-classes-have-attributes
17
17
 
18
18
  from typing import Tuple
19
- # Import libraries
20
19
  import tensorflow as tf, tf_keras
21
20
 
22
21
  from official.modeling import tf_utils
@@ -14,8 +14,6 @@
14
14
 
15
15
  """TN-BERT TNTransformerExpandCondense employing Expand-Condense layer instead of Dense."""
16
16
  # pylint: disable=g-classes-have-attributes
17
- # Import libraries
18
-
19
17
  import gin
20
18
  import tensorflow as tf, tf_keras
21
19
 
@@ -14,8 +14,6 @@
14
14
 
15
15
  """Instance prediction heads."""
16
16
 
17
- # Import libraries
18
-
19
17
  from absl import logging
20
18
  import tensorflow as tf, tf_keras
21
19
 
@@ -14,7 +14,6 @@
14
14
 
15
15
  """Tests for instance_heads.py."""
16
16
 
17
- # Import libraries
18
17
  from absl.testing import parameterized
19
18
  import numpy as np
20
19
  import tensorflow as tf, tf_keras
@@ -16,8 +16,6 @@
16
16
 
17
17
  from typing import List, Mapping, Optional, Union
18
18
 
19
- # Import libraries
20
-
21
19
  from absl import logging
22
20
  import tensorflow as tf, tf_keras
23
21
 
@@ -14,8 +14,6 @@
14
14
 
15
15
  """Tests for maskrcnn_model.py."""
16
16
 
17
- # Import libraries
18
-
19
17
  from absl.testing import parameterized
20
18
  import numpy as np
21
19
  import tensorflow as tf, tf_keras
@@ -250,3 +250,16 @@ def get_shape_from_length(length: int, height: int = 1, width: int = 1):
250
250
  f'Invalid sequence length: {length} or shape: ({height, width}).'
251
251
  )
252
252
  return (input_height, input_width)
253
+
254
+
255
+ def absolute_position_encoding(
256
+ position: tf.Tensor, hidden_size: int, dtype=tf.float32) -> tf.Tensor:
257
+ """Create absoulte position encoding."""
258
+ position = tf.cast(position, dtype)
259
+ half_hid = hidden_size // 2
260
+ freq_seq = tf.cast(tf.range(half_hid), dtype=dtype)
261
+ inv_freq = 1 / (10000 ** (freq_seq / half_hid))
262
+ sinusoid = tf.einsum('S,D->SD', position, inv_freq)
263
+ sin = tf.sin(sinusoid)
264
+ cos = tf.cos(sinusoid)
265
+ return tf.concat([sin, cos], axis=-1)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tf-models-nightly
3
- Version: 2.19.0.dev20241213
3
+ Version: 2.19.0.dev20241214
4
4
  Summary: TensorFlow Official Models
5
5
  Home-page: https://github.com/tensorflow/models
6
6
  Author: Google Inc.
@@ -321,7 +321,7 @@ official/nlp/modeling/layers/masked_lm.py,sha256=UfDdLJDdIJbPTmwDVmsuXGAwzP2UK6z
321
321
  official/nlp/modeling/layers/masked_lm_test.py,sha256=2Nkn1VE3_JSUCvHTceXsR2PTJXZ5MkCRFeBMgMcxWF4,5947
322
322
  official/nlp/modeling/layers/masked_softmax.py,sha256=929iFmfGkoyPbXAz_S_IsUiERzCYaeEMEFyjjYNH35g,3000
323
323
  official/nlp/modeling/layers/masked_softmax_test.py,sha256=o7cBVceaUKOuBso_Lq2_JZMKVYQvBJDaz64bhQIl808,4403
324
- official/nlp/modeling/layers/mat_mul_with_margin.py,sha256=4O1zWh3qoFIKR0HVLDSeOjxFqcNcUzBOTweVSgJ0cRY,2260
324
+ official/nlp/modeling/layers/mat_mul_with_margin.py,sha256=SMYEkyiVjWoPSFJrTBjsOFIrN0_WJqaRvvtQ4VG5woE,2241
325
325
  official/nlp/modeling/layers/mat_mul_with_margin_test.py,sha256=t0Y_p4hHfrJyyoxk5vzcfzjV0NKgXtPToab7Fyj21Qc,2032
326
326
  official/nlp/modeling/layers/mixing.py,sha256=iGQ0kPfefIvTAQfVDZtpLW3wBHSpEmIEanrRyckaPqk,9743
327
327
  official/nlp/modeling/layers/mixing_test.py,sha256=2yzWg-oyufrOmPQAPw0btpltOeSFI_379WEv4pLx9L0,3559
@@ -360,7 +360,7 @@ official/nlp/modeling/layers/text_layers.py,sha256=EvgjMxQ-8o0B4ewaL_TpKIAvGakkt
360
360
  official/nlp/modeling/layers/text_layers_test.py,sha256=_GRi-AZ4jBBcAFxtzGtWe9jBD7i8w4DIEQj17r1JKHU,24255
361
361
  official/nlp/modeling/layers/tn_expand_condense.py,sha256=AujG4hxtCL36VwIBnRv7R2Ee0wTSbYCRy8KaaUQW-Xc,6713
362
362
  official/nlp/modeling/layers/tn_expand_condense_test.py,sha256=J52mXzoiuaXfR61khTWf0tdnrQbc4fkyCguFsXxGLTU,5900
363
- official/nlp/modeling/layers/tn_transformer_expand_condense.py,sha256=gbGJOrgxJd1SyMGB6ME04FSxuZfHqsi94Xxt23l7368,11032
363
+ official/nlp/modeling/layers/tn_transformer_expand_condense.py,sha256=u-0AzKOES_RN8ymSGH8suM19h1GgxaP40buuE1km5fM,11012
364
364
  official/nlp/modeling/layers/tn_transformer_test.py,sha256=Fh-EDRoAkhO7ccD3w3FsJHC51MnZySv8jBlHYnvKZMc,8893
365
365
  official/nlp/modeling/layers/transformer.py,sha256=yofIEOjZpcvDmHbcjBmkZrl5iSe6pLtMsetNbXmxDnY,20087
366
366
  official/nlp/modeling/layers/transformer_encoder_block.py,sha256=14dgbg6z9xeXl2trEJkxsVyQPguQ9m7U20aDAmOVDQE,24930
@@ -519,12 +519,12 @@ official/projects/deepmac_maskrcnn/configs/__init__.py,sha256=7oiypy0N82PDw9aSdc
519
519
  official/projects/deepmac_maskrcnn/configs/deep_mask_head_rcnn.py,sha256=s32iUX-M99epvI9EZRcPZ_i5U-IGlrNn2DJrqPumShc,8024
520
520
  official/projects/deepmac_maskrcnn/configs/deep_mask_head_rcnn_config_test.py,sha256=eyFpkyx2ZKmRJWivHYrWxjrtmK8CCB_knVW3gg8TQD4,1228
521
521
  official/projects/deepmac_maskrcnn/modeling/__init__.py,sha256=7oiypy0N82PDw9aSdcJBLVoGTd_oRSUOdvuJhMv4leQ,609
522
- official/projects/deepmac_maskrcnn/modeling/maskrcnn_model.py,sha256=RSKmxdvpPiqH6vcwjA2pqCntJeDYbI6Hto5fUkHD0GE,9666
523
- official/projects/deepmac_maskrcnn/modeling/maskrcnn_model_test.py,sha256=0wd1pyKjDlVdXYbXUlXHalwNyjSSRrVbboShG9fDmd8,5741
522
+ official/projects/deepmac_maskrcnn/modeling/maskrcnn_model.py,sha256=KYk3kYuACCncCM5AA-UkDVDvQNJ-LIBn_mRBfpdUSqQ,9646
523
+ official/projects/deepmac_maskrcnn/modeling/maskrcnn_model_test.py,sha256=IFa7bcw1LmsSknW44jSyTIRXq-nK8m1jzmdBkrt9GC4,5721
524
524
  official/projects/deepmac_maskrcnn/modeling/heads/__init__.py,sha256=7oiypy0N82PDw9aSdcJBLVoGTd_oRSUOdvuJhMv4leQ,609
525
525
  official/projects/deepmac_maskrcnn/modeling/heads/hourglass_network.py,sha256=aFZxj27Ie3lMzoixxRP9MqmU7jez5OVaIQR391ir2ME,21715
526
- official/projects/deepmac_maskrcnn/modeling/heads/instance_heads.py,sha256=n5woErFhTECJgux0y4EAsFNUC5XGcCSLkc7tcYr9OKQ,11476
527
- official/projects/deepmac_maskrcnn/modeling/heads/instance_heads_test.py,sha256=rMeCPyHUWsbQrzeQNiIWUsOqo3Ai0riBa9EOWjI8Uo4,3182
526
+ official/projects/deepmac_maskrcnn/modeling/heads/instance_heads.py,sha256=PnEgcg0ae6327-UIOZhSb9ude9PvBl6_fHkvFC1EKzQ,11456
527
+ official/projects/deepmac_maskrcnn/modeling/heads/instance_heads_test.py,sha256=fYm1LXt9Mg-CgQZOJ99aWoiCX7Fe3K60CWgUeIECL74,3163
528
528
  official/projects/deepmac_maskrcnn/serving/__init__.py,sha256=7oiypy0N82PDw9aSdcJBLVoGTd_oRSUOdvuJhMv4leQ,609
529
529
  official/projects/deepmac_maskrcnn/serving/detection.py,sha256=VmQNvhVwksD4OeMed0lD3mTlic-RSkJ1Vkqb4byT1SQ,5504
530
530
  official/projects/deepmac_maskrcnn/serving/detection_test.py,sha256=t5YdUlmPa3FtyzGEhxDutr5rzDl4U8j5RqIc3Gj00Fw,6362
@@ -556,7 +556,7 @@ official/projects/maxvit/configs/retinanet_test.py,sha256=wJ-emOuFszh41Q7QEmkFv0
556
556
  official/projects/maxvit/configs/semantic_segmentation.py,sha256=1E_uxViXeSWk_lg8UG0_OmQRIzDsuLheuMEPIjemG5s,8657
557
557
  official/projects/maxvit/configs/semantic_segmentation_test.py,sha256=Egw4ySa8f9PmI4TrpYLWzAFaIX75JVUFd-la2F767To,1583
558
558
  official/projects/maxvit/modeling/__init__.py,sha256=7oiypy0N82PDw9aSdcJBLVoGTd_oRSUOdvuJhMv4leQ,609
559
- official/projects/maxvit/modeling/common_ops.py,sha256=EzwIfsLwMhndRmZerLD1dVmLI1lf0vXfME8e86yGTmU,8464
559
+ official/projects/maxvit/modeling/common_ops.py,sha256=4rg6Tcu395YHDZQSkfDlQ_juputU1Hcf0m974dhd2Z4,8932
560
560
  official/projects/maxvit/modeling/layers.py,sha256=qxSXCR1ySvsPawWUR8Fs0ArNlGgd1GuAsROyI6tbvQg,28938
561
561
  official/projects/maxvit/modeling/maxvit.py,sha256=ZQo2knavIlJhJwA-JgaQU117w6rtqP3DtgFDJdVUKLo,32353
562
562
  official/projects/maxvit/modeling/maxvit_test.py,sha256=zHjO-AQR78OlbY8Xqn1xZvZ24K5znUZQ0rqiYJ49zTo,4753
@@ -1222,9 +1222,9 @@ tensorflow_models/tensorflow_models_test.py,sha256=nc6A9K53OGqF25xN5St8EiWvdVbda
1222
1222
  tensorflow_models/nlp/__init__.py,sha256=4tA5Pf4qaFwT-fIFOpX7x7FHJpnyJT-5UgOeFYTyMlc,807
1223
1223
  tensorflow_models/uplift/__init__.py,sha256=mqfa55gweOdpKoaQyid4A_4u7xw__FcQeSIF0k_pYmI,999
1224
1224
  tensorflow_models/vision/__init__.py,sha256=zBorY_v5xva1uI-qxhZO3Qh-Dii-Suq6wEYh6hKHDfc,833
1225
- tf_models_nightly-2.19.0.dev20241213.dist-info/AUTHORS,sha256=1dG3fXVu9jlo7bul8xuix5F5vOnczMk7_yWn4y70uw0,337
1226
- tf_models_nightly-2.19.0.dev20241213.dist-info/LICENSE,sha256=WxeBS_DejPZQabxtfMOM_xn8qoZNJDQjrT7z2wG1I4U,11512
1227
- tf_models_nightly-2.19.0.dev20241213.dist-info/METADATA,sha256=MLhkqNGcxYYihhUVIEjbtIreAoo8H0WYWNolNyHOqPM,1432
1228
- tf_models_nightly-2.19.0.dev20241213.dist-info/WHEEL,sha256=kGT74LWyRUZrL4VgLh6_g12IeVl_9u9ZVhadrgXZUEY,110
1229
- tf_models_nightly-2.19.0.dev20241213.dist-info/top_level.txt,sha256=gum2FfO5R4cvjl2-QtP-S1aNmsvIZaFFT6VFzU0f4-g,33
1230
- tf_models_nightly-2.19.0.dev20241213.dist-info/RECORD,,
1225
+ tf_models_nightly-2.19.0.dev20241214.dist-info/AUTHORS,sha256=1dG3fXVu9jlo7bul8xuix5F5vOnczMk7_yWn4y70uw0,337
1226
+ tf_models_nightly-2.19.0.dev20241214.dist-info/LICENSE,sha256=WxeBS_DejPZQabxtfMOM_xn8qoZNJDQjrT7z2wG1I4U,11512
1227
+ tf_models_nightly-2.19.0.dev20241214.dist-info/METADATA,sha256=kKOZ34e7VOmAPWKBetXJqK12NOkbBQcYMTxY_D1oTBE,1432
1228
+ tf_models_nightly-2.19.0.dev20241214.dist-info/WHEEL,sha256=kGT74LWyRUZrL4VgLh6_g12IeVl_9u9ZVhadrgXZUEY,110
1229
+ tf_models_nightly-2.19.0.dev20241214.dist-info/top_level.txt,sha256=gum2FfO5R4cvjl2-QtP-S1aNmsvIZaFFT6VFzU0f4-g,33
1230
+ tf_models_nightly-2.19.0.dev20241214.dist-info/RECORD,,