Class: TensorFlow::Keras::Metrics::Mean
- Inherits:
-
Object
- Object
- TensorFlow::Keras::Metrics::Mean
- Defined in:
- lib/tensorflow/keras/metrics/mean.rb
Instance Method Summary collapse
Instance Method Details
#result ⇒ Object
11 12 13 |
# File 'lib/tensorflow/keras/metrics/mean.rb', line 11 def result RawOps.div_no_nan(x: @total, y: TensorFlow.cast(@count, :float)) end |
#update_state(values) ⇒ Object
5 6 7 8 9 |
# File 'lib/tensorflow/keras/metrics/mean.rb', line 5 def update_state(values) input = TensorFlow.convert_to_tensor(values, dtype: :float) @total = Math.reduce_sum(input) @count = RawOps.size(input: input) end |