Skip to content
Snippets Groups Projects
Commit 6d5aeaae authored by dding3's avatar dding3 Committed by Sean Owen
Browse files

[SPARK-14969][MLLIB] Remove duplicate implementation of compute in LogisticGradient

## What changes were proposed in this pull request?

This PR removes duplicate implementation of compute in LogisticGradient class

## How was this patch tested?

unit tests

Author: dding3 <dingding@dingding-ubuntu.sh.intel.com>

Closes #12747 from dding3/master.
parent 7226e190
No related branches found
No related tags found
No related merge requests found
......@@ -577,13 +577,6 @@ private[ann] object FeedForwardModel {
* @param dataStacker data stacker
*/
private[ann] class ANNGradient(topology: Topology, dataStacker: DataStacker) extends Gradient {
override def compute(data: Vector, label: Double, weights: Vector): (Vector, Double) = {
val gradient = Vectors.zeros(weights.size)
val loss = compute(data, label, weights, gradient)
(gradient, loss)
}
override def compute(
data: Vector,
label: Double,
......
......@@ -146,12 +146,6 @@ class LogisticGradient(numClasses: Int) extends Gradient {
def this() = this(2)
override def compute(data: Vector, label: Double, weights: Vector): (Vector, Double) = {
val gradient = Vectors.zeros(weights.size)
val loss = compute(data, label, weights, gradient)
(gradient, loss)
}
override def compute(
data: Vector,
label: Double,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment