@property
def value(self):
Returns the value of accumulator variable which is reset.
return tf.identity(self._acc_var)
@property
def accumulated_value(self):
Returns the accumulated value.
After Change
@property
def value(self):
Returns the average of the accumulated values since the last reset.
return self._acc_var / tf.cast(self._counter, self._acc_var.dtype)
def read_value_and_reset(self):
Same as `value` property but resets after the data is read.
value = self.value