Github user bgreeven commented on the pull request:

    https://github.com/apache/spark/pull/1290#issuecomment-67584041
  
    > @bgreeven I have cloned your branch and am trying to run the MNIST 
dataset.
    > I can't quite understand how to set the number of output neurons though.
    > The topology array seems to only apply to the hidden layers. I have seen
    > some tests of MNIST on your code though, so I was curious how this was
    > done?
    
    The ANN learns the number of input nodes and number of output nodes from a 
sample from the data. This is done automatically when invoking the train 
function.
    
    The ArtificialNeuralNetwork object/class only does approximation, not 
classification. To do classification, you best use the ANNClassifier 
object/class.
    
    The simplest call to ANNClassifier is the following:
    ```
    val model = ANNClassifier.train(data)
    ```
    where `data: RDD[LabeledPoint]`
    
    In this case, the features of each LabeledPoint are the bitmap values, 
whereas the label could be one of the values 0, 1, ..., 9.
    
    Subsequent prediction can be done by
    ```
    val predictedLabel = model.predict(v)
    ```
    
    where v is a vector of features, and the output is one of the labels 0, 1, 
...9.



---
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