Github user bgreeven commented on the pull request:

    https://github.com/apache/spark/pull/1290#issuecomment-52889153
  
    I have updated the code. Indeed the LeastSquaresGradientANN.compute 
function was the culprit.
    
    I removed the Breeze instructions, and replaced them by simple 
Array[Double] instructions. I think especially the removal of taking a Breeze 
subvector helps.
    
    In addition, there are some values that could be re-used, and don't need 
re-calculation for each loop in the LeastSquaresGradientANN.compute function. 
So I have changed the loop order and moved some computations up the loop 
hierarchy.
    
    There is considerable speed-up. It now works well with a test set size of 
256 input, 128 hidden and 26 output nodes (letter classifier).
    
    
    From: Alexander Ulanov [mailto:[email protected]]
    Sent: 18 August 2014 16:41
    To: apache/spark
    Cc: Bert Greevenbosch
    Subject: Re: [spark] [MLLIB] [spark-2352] Implementation of an 1-hidden 
layer Artificial Neural Network (ANN) (#1290)
    
    
    @bgreeven<https://github.com/bgreeven> I've looked at your code and the 
algorithm seems to be implemented correctly to the best of my knowledge. 
Probably, copying of the array of weights harms the performance. I played with 
single threaded implementation of perceptron in Scala and it works fine for my 
size of data (i.e. around few minutes).
    
    —
    Reply to this email directly or view it on 
GitHub<https://github.com/apache/spark/pull/1290#issuecomment-52465553>.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to