# MetricsHelper

public class MetricsHelper

These are helper methods for Metrics and will be module private when Java modularity is applied to TensorFlow Java. These methods should not be used outside of the metrics packages.

### Constants

 float NEG_INF

### Public Methods

 static Op (Ops tf, Operand sampleWeights, Operand values) Asserts that the ``` sampleWeights ``` can be broadcast to the same shape as ``` values ``` In losses and metrics, limited weight broadcasting is supported. static Operand < TFloat64 > (Ops tf, Operand < TBool > x) Calculate the mean of the operand, along all axes and ``` keepDims ``` is ``` false ``` static Operand < TFloat64 > (Ops tf, Operand < TBool > x, boolean keepDims) Calculates the mean of the boolean operand, alongside all axes. static Operand < TFloat64 > (Ops tf, Operand < TBool > x, Operand axes) Calculate the mean of the operand, alongside the specified axis with ``` keepDims ``` is ``` false ``` static Operand < TFloat64 > (Ops tf, Operand < TBool > x, Operand axes, boolean keepDims) Calculates the mean of the boolean operand, alongside the specified axes. static Operand (Ops tf, Operand weights, Operand values) Broadcast ``` weights ``` to the same shape as ``` values ``` . static Operand (Ops tf, Operand x) Calculate the mean of the operand, along all axes and ``` keepDims ``` is ``` false ``` static Operand (Ops tf, Operand x, Operand axes) Calculate the mean of the operand, alongside the specified axis with ``` keepDims ``` is ``` false ``` static Operand (Ops tf, Operand x, Operand axes, boolean keepDims) Calculates the mean of the operand, alongside the specified axes. static Operand (Ops tf, Operand x, boolean keepDims) Calculates the mean of the operand, along all axes.

## Constants

#### public static final float NEG_INF

Constant Value: -1.0E10

## Public Methods

#### public static Op assertBroadcastable (Ops tf, Operand <T> sampleWeights, Operand <T> values)

Asserts that the ``` sampleWeights ``` can be broadcast to the same shape as ``` values ```

In losses and metrics, limited weight broadcasting is supported. Weights must be either scalar, or the same rank as the target values, with each dimension either 1, or the same as the corresponding values dimension.

##### Parameters
 tf the TensorFlow Ops the sample weights. the values to which weights are applied.
##### Returns
• ``` Operation ``` with control dependencies to ensure ``` sampleWeight ``` can be broadcast to ``` values ```
##### Throws
 NotBroadcastableException If static checks determine ``` sampleWeights ``` has an incorrect shape that prohibit broadcasting to ``` values ```

#### public static Operand < TFloat64 > booleanMean (Ops tf, Operand < TBool > x)

Calculate the mean of the operand, along all axes and ``` keepDims ``` is ``` false ```

##### Parameters
 tf the TensorFlow Ops the Operand used to calculate the mean
##### Returns
• the mean of the operand containing floating point numbers

#### public static Operand < TFloat64 > booleanMean (Ops tf, Operand < TBool > x, boolean keepDims)

Calculates the mean of the boolean operand, alongside all axes.

##### Parameters
 tf the TensorFlow Ops the boolean Operand used to calculate the mean Indicates whether to keep the dimensions or not. If ``` keepdims ``` is ``` false ``` , the rank of the tensor is reduced by 1 for each entry in ``` axes ``` . If ``` keepdims ``` is ``` true ``` , the reduced dimensions are retained with length 1.
##### Returns
• the mean of elements of ``` x ``` containing floating point numbers

#### public static Operand < TFloat64 > booleanMean (Ops tf, Operand < TBool > x, Operand <? extends TIntegral > axes)

Calculate the mean of the operand, alongside the specified axis with ``` keepDims ``` is ``` false ```

##### Parameters
 tf the TensorFlow Ops the Operand used to calculate the mean Axes to compute the mean.
##### Returns
• the mean of the operand, along the specified axes, containing floating point numbers

#### public static Operand < TFloat64 > booleanMean (Ops tf, Operand < TBool > x, Operand <? extends TIntegral > axes, boolean keepDims)

Calculates the mean of the boolean operand, alongside the specified axes.

##### Parameters
 tf the TensorFlow Ops the boolean Operand used to calculate the mean Axes to compute the mean. Indicates whether to keep the dimensions or not. If ``` keepdims ``` is ``` false ``` , the rank of the tensor is reduced by 1 for each entry in ``` axes ``` . If ``` keepdims ``` is ``` true ``` , the reduced dimensions are retained with length 1.
##### Returns
• the mean of elements of ``` x ``` containing floating point numbers

#### public static Operand <T> broadcastWeights (Ops tf, Operand <T> weights, Operand <T> values)

Broadcast ``` weights ``` to the same shape as ``` values ``` .

##### Parameters
 tf the TensorFlow ops Operand whose shape is broadcastable to ``` values ``` . Operand of any shape
##### Returns
• ``` weights ``` broadcast to ``` values ``` shape

#### public static Operand <T> mean (Ops tf, Operand <T> x)

Calculate the mean of the operand, along all axes and ``` keepDims ``` is ``` false ```

##### Parameters
 tf the TensorFlow Ops the Operand used to calculate the mean
##### Returns
• the mean of the operand

#### public static Operand <T> mean (Ops tf, Operand <T> x, Operand <? extends TIntegral > axes)

Calculate the mean of the operand, alongside the specified axis with ``` keepDims ``` is ``` false ```

##### Parameters
 tf the TensorFlow Ops the Operand used to calculate the mean Axes to compute the mean.
##### Returns
• the mean of the operand, along the specified axes.

#### public static Operand <T> mean (Ops tf, Operand <T> x, Operand <? extends TIntegral > axes, boolean keepDims)

Calculates the mean of the operand, alongside the specified axes.

##### Parameters
 tf the TensorFlow Ops the Operand used to calculate the mean Axes to compute the mean. Indicates whether to keep the dimensions or not. If ``` keepdims ``` is ``` false ``` , the rank of the tensor is reduced by 1 for each entry in ``` axes ``` . If ``` keepdims ``` is ``` true ``` , the reduced dimensions are retained with length 1.
##### Returns
• the mean of elements of ``` x ``` .

#### public static Operand <T> mean (Ops tf, Operand <T> x, boolean keepDims)

Calculates the mean of the operand, along all axes.

##### Parameters
 tf the TensorFlow Ops the Operand used to calculate the mean Indicates whether to keep the dimensions or not. If ``` keepdims ``` is ``` false ``` , the rank of the tensor is reduced by 1 for each entry in ``` axes ``` . If ``` keepdims ``` is ``` true ``` , the reduced dimensions are retained with length 1.
##### Returns
• the mean of elements of ``` x ``` .
[{ "type": "thumb-down", "id": "missingTheInformationINeed", "label":"Missing the information I need" },{ "type": "thumb-down", "id": "tooComplicatedTooManySteps", "label":"Too complicated / too many steps" },{ "type": "thumb-down", "id": "outOfDate", "label":"Out of date" },{ "type": "thumb-down", "id": "samplesCodeIssue", "label":"Samples / code issue" },{ "type": "thumb-down", "id": "otherDown", "label":"Other" }]
[{ "type": "thumb-up", "id": "easyToUnderstand", "label":"Easy to understand" },{ "type": "thumb-up", "id": "solvedMyProblem", "label":"Solved my problem" },{ "type": "thumb-up", "id": "otherUp", "label":"Other" }]