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

Class LayerWithMetrics

tensorflow/python/keras/custom_training_loop_test.py:49–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47
48
49class LayerWithMetrics(keras.layers.Layer):
50
51 def build(self, input_shape):
52 self.mean = keras.metrics.Mean(name='mean_object')
53
54 def call(self, inputs):
55 self.add_metric(
56 math_ops.reduce_mean(inputs), name='mean_tensor', aggregation='mean')
57 self.add_metric(self.mean(inputs))
58 return inputs
59
60
61class LayerWithTrainingArg(keras.layers.Layer):

Callers 1

add_metric_stepFunction · 0.85

Calls

no outgoing calls

Tested by 1

add_metric_stepFunction · 0.68