Computes the element-wise (weighted) mean of the given tensors

metric_mean_tensor(..., shape = NULL, name = NULL, dtype = NULL)

Arguments

...

Passed on to the underlying metric. Used for forwards and backwards compatibility.

shape

(Optional) A list of integers, a list of integers, or a 1-D Tensor of type int32. If not specified, the shape is inferred from the values at the first call of update_state.

name

(Optional) string name of the metric instance.

dtype

(Optional) data type of the metric result.

Value

A (subclassed) Metric instance that can be passed directly to compile(metrics = ), or used as a standalone object. See ?Metric for example usage.

Details

MeanTensor returns a tensor with the same shape of the input tensors. The mean value is updated by keeping local variables total and count. The total tracks the sum of the weighted values, and count stores the sum of the weighted counts.

See also