Skip to content

Commit

Permalink
no-op
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 333002939
  • Loading branch information
jindalshivam09 authored and tf-model-analysis-team committed Sep 22, 2020
1 parent 317481d commit 2f346af
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def testFairnessIndicatorsCounters(self):

def check_metric_counter(result):
metric_filter = beam.metrics.metric.MetricsFilter().with_name(
'metric_computed_fairness_indicators')
'metric_computed_fairness_indicators_v1')
actual_metrics_count = result.metrics().query(
filter=metric_filter)['counters'][0].committed
self.assertEqual(actual_metrics_count, 2)
Expand Down
8 changes: 4 additions & 4 deletions tensorflow_model_analysis/evaluators/counter_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
from tensorflow_model_analysis import types


def _IncrementMetricsCounters(metric_name: Text):
def _IncrementMetricsCounters(metric_name: Text, version: Text):
# LINT.IfChange
metric_name = 'metric_computed_%s' % metric_name
metric_name = 'metric_computed_%s_%s' % (metric_name, version)
# LINT.ThenChange(../../../../learning/fairness/infra/plx/scripts/tfma_metrics_computed_tracker_macros.sql)
metrics_counter = beam.metrics.Metrics.counter(constants.METRICS_NAMESPACE,
metric_name)
Expand All @@ -48,7 +48,7 @@ def IncrementMetricsCallbacksCounters(
def _MakeAndIncrementCounters(_):
for callback in metrics_callbacks:
if hasattr(callback, 'name'):
_IncrementMetricsCounters(callback.name)
_IncrementMetricsCounters(callback.name, 'v1')

return (pipeline
| 'CreateSole' >> beam.Create([None])
Expand Down Expand Up @@ -85,7 +85,7 @@ def IncrementMetricsSpecsCounters(pipeline: beam.Pipeline,
def _MakeAndIncrementCounters(_):
for metrics_spec in metrics_specs:
for metric in metrics_spec.metrics:
_IncrementMetricsCounters(metric.class_name)
_IncrementMetricsCounters(metric.class_name, 'v2')

return (pipeline
| 'CreateSole' >> beam.Create([None])
Expand Down
4 changes: 2 additions & 2 deletions tensorflow_model_analysis/evaluators/counter_util_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def testMetricComputedBeamCounter(self):

result = pipeline.run()
metric_filter = beam.metrics.metric.MetricsFilter().with_namespace(
constants.METRICS_NAMESPACE).with_name('metric_computed_auc')
constants.METRICS_NAMESPACE).with_name('metric_computed_auc_v1')
actual_metrics_count = result.metrics().query(
filter=metric_filter)['counters'][0].committed

Expand Down Expand Up @@ -67,7 +67,7 @@ def testMetricsSpecBeamCounter(self):
result = pipeline.run()
metric_filter = beam.metrics.metric.MetricsFilter().with_namespace(
constants.METRICS_NAMESPACE).with_name(
'metric_computed_FairnessIndicators')
'metric_computed_FairnessIndicators_v2')
actual_metrics_count = result.metrics().query(
filter=metric_filter)['counters'][0].committed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ def check_validations(got):
check_validations)

metric_filter = beam.metrics.metric.MetricsFilter().with_name(
'metric_computed_ExampleCount')
'metric_computed_ExampleCount_v2')
print(pipeline.run().metrics().query())
actual_metrics_count = pipeline.run().metrics().query(
filter=metric_filter)['counters'][0].committed
Expand Down

0 comments on commit 2f346af

Please sign in to comment.