MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / result

Method result

tensorflow/contrib/eager/python/metrics_impl.py:340–362  ·  view source on GitHub ↗

Returns the result of the Metric. Args: write_summary: bool indicating whether to feed the result to the summary before returning. Returns: aggregated metric as float. Raises: ValueError: if the optional argument is not bool

(self, write_summary=True)

Source from the content-addressed store, hash-verified

338 return values, weights
339
340 def result(self, write_summary=True):
341 """Returns the result of the Metric.
342
343 Args:
344 write_summary: bool indicating whether to feed the result to the summary
345 before returning.
346 Returns:
347 aggregated metric as float.
348 Raises:
349 ValueError: if the optional argument is not bool
350 """
351 # Convert the boolean to tensor for tf.cond, if it is not.
352 if not isinstance(write_summary, ops.Tensor):
353 write_summary = ops.convert_to_tensor(write_summary)
354 t = self.numer / self.denom
355 def write_summary_f():
356 summary_ops.scalar(name=self.name, tensor=t)
357 return t
358 smart_cond.smart_cond(write_summary,
359 write_summary_f,
360 lambda: t,
361 name="")
362 return t
363
364
365class Accuracy(Mean):

Callers 15

testMeanMethod · 0.95
testInitVariablesMethod · 0.95
testWriteSummariesMethod · 0.95
testWeightedMeanMethod · 0.95
testMeanDtypeMethod · 0.95
testTwoMeansMethod · 0.95
testMetricsChainMethod · 0.95
evaluateFunction · 0.95

Calls

no outgoing calls

Tested by 15

testMeanMethod · 0.76
testInitVariablesMethod · 0.76
testWriteSummariesMethod · 0.76
testWeightedMeanMethod · 0.76
testMeanDtypeMethod · 0.76
testTwoMeansMethod · 0.76
testMetricsChainMethod · 0.76
test_meanMethod · 0.76