Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 854652009A8 for ; Tue, 17 May 2016 14:11:14 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 8410C160A20; Tue, 17 May 2016 12:11:14 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id D570D1609AE for ; Tue, 17 May 2016 14:11:13 +0200 (CEST) Received: (qmail 54143 invoked by uid 500); 17 May 2016 12:11:13 -0000 Mailing-List: contact issues-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flink.apache.org Delivered-To: mailing list issues@flink.apache.org Received: (qmail 54120 invoked by uid 99); 17 May 2016 12:11:13 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 May 2016 12:11:13 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id DEF1C2C1F5D for ; Tue, 17 May 2016 12:11:12 +0000 (UTC) Date: Tue, 17 May 2016 12:11:12 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@flink.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (FLINK-1979) Implement Loss Functions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 17 May 2016 12:11:14 -0000 [ https://issues.apache.org/jira/browse/FLINK-1979?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1528= 6480#comment-15286480 ]=20 ASF GitHub Bot commented on FLINK-1979: --------------------------------------- Github user tillrohrmann commented on a diff in the pull request: https://github.com/apache/flink/pull/1985#discussion_r63510204 =20 --- Diff: flink-libraries/flink-ml/src/main/scala/org/apache/flink/ml/o= ptimization/PartialLossFunction.scala --- @@ -47,21 +47,106 @@ object SquaredLoss extends PartialLossFunction { =20 /** Calculates the loss depending on the label and the prediction * - * @param prediction - * @param label - * @return + * @param prediction The predicted value + * @param label The true value + * @return The loss */ override def loss(prediction: Double, label: Double): Double =3D { 0.5 * (prediction - label) * (prediction - label) } =20 /** Calculates the derivative of the [[PartialLossFunction]] * - * @param prediction - * @param label - * @return + * @param prediction The predicted value + * @param label The true value + * @return The derivative of the loss function */ override def derivative(prediction: Double, label: Double): Double = =3D { (prediction - label) } } + +/** Logistic loss function which can be used with the [[GenericLossFun= ction]] + * + * + * The [[LogisticLoss]] function implements `log(1 + exp(prediction*l= abel))` --- End diff -- =20 A minus is missing in the exponent of e. > Implement Loss Functions > ------------------------ > > Key: FLINK-1979 > URL: https://issues.apache.org/jira/browse/FLINK-1979 > Project: Flink > Issue Type: Improvement > Components: Machine Learning Library > Reporter: Johannes G=C3=BCnther > Assignee: Johannes G=C3=BCnther > Priority: Minor > Labels: ML > > For convex optimization problems, optimizer methods like SGD rely on a pl= uggable implementation of a loss function and its first derivative. -- This message was sent by Atlassian JIRA (v6.3.4#6332)