Package org.nd4j.autodiff.listeners
Class Loss
- java.lang.Object
-
- org.nd4j.autodiff.listeners.Loss
-
public class Loss extends Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Lossadd(Loss other)static Lossadd(Loss a, Loss b)static Lossaverage(List<Loss> losses)Losscopy()Lossdiv(Number other)static Lossdiv(Loss a, Number b)doublegetLoss(@NonNull String lossName)Get the specified loss by nameList<String>lossNames()double[]lossValues()Lossminus(Loss other)intnumLosses()Lossplus(Loss other)Losssub(Loss other)static Losssub(Loss a, Loss b)static Losssum(List<Loss> losses)doubletotalLoss()
-
-
-
Method Detail
-
numLosses
public int numLosses()
- Returns:
- Number of loss values (i.e., length of lossNames and losses)
-
lossValues
public double[] lossValues()
- Returns:
- Values corresponding to each of the losses (same order as lossNames())
-
getLoss
public double getLoss(@NonNull @NonNull String lossName)Get the specified loss by name- Parameters:
lossName- Name of the loss (must exist)- Returns:
- Specified loss value
-
totalLoss
public double totalLoss()
- Returns:
- The total loss (sum of all loss components)
-
copy
public Loss copy()
-
-