Skip to content

Commit

Permalink
Addressing reviewers comments: unnecessary copy of data in predict
Browse files Browse the repository at this point in the history
  • Loading branch information
avulanov committed Jul 24, 2015
1 parent 35125ab commit 9d18469
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mllib/src/main/scala/org/apache/spark/mllib/ann/Layer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,8 @@ class FeedForwardModel private(val layerModels: Array[LayerModel],
}

override def predict(data: Vector): Vector = {
val result = forward(data.toBreeze.toDenseVector.toDenseMatrix.t)
val size = data.size
val result = forward(new BDM[Double](size, 1, data.toArray))
Vectors.dense(result.last.toArray)
}
}
Expand Down

0 comments on commit 9d18469

Please sign in to comment.