接口 LossFunc
-
- 所有超级接口:
Serializable
- 所有已知实现类:
BinaryLogisticLoss,HingeLoss,LeastSquareLoss
@Internal public interface LossFunc extends Serializable
A loss function is to compute the loss and gradient with the given coefficient and training data.
-
-
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 voidcomputeGradient(org.apache.flink.ml.common.feature.LabeledPointWithWeight dataPoint, org.apache.flink.ml.linalg.DenseVector coefficient, org.apache.flink.ml.linalg.DenseVector cumGradient)Computes the gradient on the given data point and adds the computed gradient to cumGradient.doublecomputeLoss(org.apache.flink.ml.common.feature.LabeledPointWithWeight dataPoint, org.apache.flink.ml.linalg.DenseVector coefficient)Computes the loss on the given data point.
-
-
-
方法详细资料
-
computeLoss
double computeLoss(org.apache.flink.ml.common.feature.LabeledPointWithWeight dataPoint, org.apache.flink.ml.linalg.DenseVector coefficient)Computes the loss on the given data point.- 参数:
dataPoint- A training data point.coefficient- The model parameters.- 返回:
- The loss of the input data.
-
computeGradient
void computeGradient(org.apache.flink.ml.common.feature.LabeledPointWithWeight dataPoint, org.apache.flink.ml.linalg.DenseVector coefficient, org.apache.flink.ml.linalg.DenseVector cumGradient)Computes the gradient on the given data point and adds the computed gradient to cumGradient.- 参数:
dataPoint- A training data point.coefficient- The model parameters.cumGradient- The accumulated gradient.
-
-