tf-models-nightly 2.17.0.dev20240617__py2.py3-none-any.whl → 2.17.0.dev20240618__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.
- official/recommendation/uplift/metrics/variance_test.py +11 -9
- {tf_models_nightly-2.17.0.dev20240617.dist-info → tf_models_nightly-2.17.0.dev20240618.dist-info}/METADATA +1 -1
- {tf_models_nightly-2.17.0.dev20240617.dist-info → tf_models_nightly-2.17.0.dev20240618.dist-info}/RECORD +7 -7
- {tf_models_nightly-2.17.0.dev20240617.dist-info → tf_models_nightly-2.17.0.dev20240618.dist-info}/AUTHORS +0 -0
- {tf_models_nightly-2.17.0.dev20240617.dist-info → tf_models_nightly-2.17.0.dev20240618.dist-info}/LICENSE +0 -0
- {tf_models_nightly-2.17.0.dev20240617.dist-info → tf_models_nightly-2.17.0.dev20240618.dist-info}/WHEEL +0 -0
- {tf_models_nightly-2.17.0.dev20240617.dist-info → tf_models_nightly-2.17.0.dev20240618.dist-info}/top_level.txt +0 -0
@@ -138,19 +138,19 @@ class VarianceTest(keras_test_case.KerasTestCase, parameterized.TestCase):
|
|
138
138
|
def test_float_sample_weight(self, values, sample_weight, expected_variance):
|
139
139
|
metric = variance.Variance()
|
140
140
|
metric(values, sample_weight=sample_weight)
|
141
|
-
self.
|
141
|
+
self.assertAllClose(expected_variance, metric.result())
|
142
142
|
|
143
143
|
def test_empty_input(self):
|
144
144
|
metric = variance.Variance()
|
145
145
|
values = tf.constant([0, 1, 2, 3])
|
146
146
|
metric(values)
|
147
|
-
self.
|
147
|
+
self.assertAllClose(1.25, metric.result())
|
148
148
|
metric(tf.ones(shape=(0,)), sample_weight=None)
|
149
|
-
self.
|
149
|
+
self.assertAllClose(1.25, metric.result())
|
150
150
|
|
151
151
|
def test_initial_state(self):
|
152
152
|
metric = variance.Variance()
|
153
|
-
self.
|
153
|
+
self.assertAllClose(0.0, metric.result())
|
154
154
|
|
155
155
|
def test_dtype_correctness(self):
|
156
156
|
# 1 << 128 overflows for float32 but fits in float64.
|
@@ -196,24 +196,26 @@ class VarianceTest(keras_test_case.KerasTestCase, parameterized.TestCase):
|
|
196
196
|
values = tf.constant([1, 2, 1, 4])
|
197
197
|
metric.update_state(values)
|
198
198
|
|
199
|
-
self.
|
200
|
-
self.
|
199
|
+
self.assertAllClose(values.numpy().var(), metric.result())
|
200
|
+
self.assertAllClose(values.numpy().var(), metric.result())
|
201
201
|
|
202
202
|
metric.update_state(tf.constant([-1, -2, 0]))
|
203
203
|
|
204
|
-
self.
|
204
|
+
self.assertAllClose(
|
205
|
+
np.array([1, 2, 1, 4, -1, -2, 0]).var(), metric.result()
|
206
|
+
)
|
205
207
|
|
206
208
|
def test_reset_state(self):
|
207
209
|
metric = variance.Variance()
|
208
210
|
values = tf.constant([1, 2, 1, 4])
|
209
211
|
|
210
212
|
metric.update_state(values)
|
211
|
-
self.
|
213
|
+
self.assertAllClose(1.5, metric.result())
|
212
214
|
|
213
215
|
metric.reset_state()
|
214
216
|
|
215
217
|
metric.update_state(values, sample_weight=tf.constant([1, 0, 1, 0]))
|
216
|
-
self.
|
218
|
+
self.assertAllClose(0.0, metric.result())
|
217
219
|
|
218
220
|
def test_numpy_correctness(self):
|
219
221
|
metric = variance.Variance()
|
@@ -930,7 +930,7 @@ official/recommendation/uplift/metrics/treatment_sliced_metric_test.py,sha256=-S
|
|
930
930
|
official/recommendation/uplift/metrics/uplift_mean.py,sha256=9I2_8p3bXj5S5MF1pcKzb761bE9lF45OOuInFgEK6HQ,3425
|
931
931
|
official/recommendation/uplift/metrics/uplift_mean_test.py,sha256=oZZjdSORNGhQLUMmUy-imz65Kc3OapzKFH5iYYdMmS4,7411
|
932
932
|
official/recommendation/uplift/metrics/variance.py,sha256=rhwZzUX-cRbwr-7vhC0I0bEQ9KpeHoPq2T0tijdO3G4,2332
|
933
|
-
official/recommendation/uplift/metrics/variance_test.py,sha256=
|
933
|
+
official/recommendation/uplift/metrics/variance_test.py,sha256=rSKjdAGxCoZNL3Y_cMFjp7fzWNoRMl_uRFzW5ddpNOs,7798
|
934
934
|
official/recommendation/uplift/models/__init__.py,sha256=kWy2K5LGXHVyyrTjJvbVFcBjj1bjPRI2dpIq-sfdhvo,716
|
935
935
|
official/recommendation/uplift/models/two_tower_uplift_model.py,sha256=Fb6nLFAOqch81ravK57K9kggAeqvtJcBtKGZwCex0ts,5028
|
936
936
|
official/recommendation/uplift/models/two_tower_uplift_model_test.py,sha256=J7qC9f0fDG1aIrLz85K1qUzTFyAIH0v8eA1yfPJb9YY,10061
|
@@ -1212,9 +1212,9 @@ tensorflow_models/tensorflow_models_test.py,sha256=nc6A9K53OGqF25xN5St8EiWvdVbda
|
|
1212
1212
|
tensorflow_models/nlp/__init__.py,sha256=4tA5Pf4qaFwT-fIFOpX7x7FHJpnyJT-5UgOeFYTyMlc,807
|
1213
1213
|
tensorflow_models/uplift/__init__.py,sha256=mqfa55gweOdpKoaQyid4A_4u7xw__FcQeSIF0k_pYmI,999
|
1214
1214
|
tensorflow_models/vision/__init__.py,sha256=zBorY_v5xva1uI-qxhZO3Qh-Dii-Suq6wEYh6hKHDfc,833
|
1215
|
-
tf_models_nightly-2.17.0.
|
1216
|
-
tf_models_nightly-2.17.0.
|
1217
|
-
tf_models_nightly-2.17.0.
|
1218
|
-
tf_models_nightly-2.17.0.
|
1219
|
-
tf_models_nightly-2.17.0.
|
1220
|
-
tf_models_nightly-2.17.0.
|
1215
|
+
tf_models_nightly-2.17.0.dev20240618.dist-info/AUTHORS,sha256=1dG3fXVu9jlo7bul8xuix5F5vOnczMk7_yWn4y70uw0,337
|
1216
|
+
tf_models_nightly-2.17.0.dev20240618.dist-info/LICENSE,sha256=WxeBS_DejPZQabxtfMOM_xn8qoZNJDQjrT7z2wG1I4U,11512
|
1217
|
+
tf_models_nightly-2.17.0.dev20240618.dist-info/METADATA,sha256=8e2zoMsfMjS1K7i_0fiD5ryok1ZSBwb42dwZbHgLUIc,1432
|
1218
|
+
tf_models_nightly-2.17.0.dev20240618.dist-info/WHEEL,sha256=kGT74LWyRUZrL4VgLh6_g12IeVl_9u9ZVhadrgXZUEY,110
|
1219
|
+
tf_models_nightly-2.17.0.dev20240618.dist-info/top_level.txt,sha256=gum2FfO5R4cvjl2-QtP-S1aNmsvIZaFFT6VFzU0f4-g,33
|
1220
|
+
tf_models_nightly-2.17.0.dev20240618.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|