# CategoricalCrossentropy

public class CategoricalCrossentropy

A Metric that computes the categorical cross-entropy loss between true labels and predicted labels.

This is the crossentropy metric class to be used when there are multiple label classes (2 or more). The labels should be given as a one_hot representation. eg., When labels values are ``` [2, 0, 1] ``` , the labels Operand contains = ``` [[0, 0, 1], [1, 0, 0], [0, 1, 0]] ``` .

### Public Constructors

 (Ops tf, String name, boolean fromLogits, float labelSmoothing, long seed, Class type) Creates a CategoricalCrossentropy metric that computes the crossentropy metric between the labels and predictions. (Ops tf, String name, boolean fromLogits, float labelSmoothing, int axis, long seed, Class type) Creates a CategoricalCrossentropy metric that computes the crossentropy metric between the labels and predictions.

### Public Methods

 Operand ( Operand labels, Operand predictions) Calculates the weighted loss between ``` labels ``` and ``` predictions ```

## Public Constructors

#### public CategoricalCrossentropy (Ops tf, String name, boolean fromLogits, float labelSmoothing, long seed, Class<T> type)

Creates a CategoricalCrossentropy metric that computes the crossentropy metric between the labels and predictions.

Uses a ``` CHANNELS_LAST ``` for the channel axis.

##### Parameters
 tf the TensorFlow Ops the name of this metric, if null then metric name is ``` getSimpleName() ``` . Whether to interpret predictions as a tensor of logit values oras opposed to a probability distribution. value used to smooth labels, When > 0, label values are smoothed, meaning the confidence on label values are relaxed. e.g. ``` labelSmoothing=0.2 ``` means that we will use a value of ``` 0.1 ``` for label ``` 0 ``` and ``` 0.9 ``` for label ``` 1 ``` the seed for random number generation. An initializer created with a given seed will always produce the same random tensor for a given shape and data type. the type for the variables and result

#### public CategoricalCrossentropy (Ops tf, String name, boolean fromLogits, float labelSmoothing, int axis, long seed, Class<T> type)

Creates a CategoricalCrossentropy metric that computes the crossentropy metric between the labels and predictions.

##### Parameters
 tf the TensorFlow Ops the name of this metric, if null then metric name is ``` getSimpleName() ``` . Whether to interpret predictions as a tensor of logit values as opposed to a probability distribution. value used to smooth labels, When > 0, label values are smoothed, meaning the confidence on label values are relaxed. e.g. ``` labelSmoothing=0.2 ``` means that we will use a value of ``` 0.1 ``` for label ``` 0 ``` and ``` 0.9 ``` for label ``` 1 ``` Int specifying the channels axis. ``` axis= CHANNELS_LAST ``` corresponds to data format ``` channels_last ``` , and ``` axis= CHANNELS_FIRST ``` corresponds to data format ``` channels_first ``` . the seed for random number generation. An initializer created with a given seed will always produce the same random tensor for a given shape and data type. the type for the variables and result

## Public Methods

#### public Operand <T> call ( Operand <? extends TNumber > labels, Operand <? extends TNumber > predictions)

Calculates the weighted loss between ``` labels ``` and ``` predictions ```

##### Parameters
 labels the truth values or labels the predictions
##### Returns
• the loss
[{ "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" }]