Hi Jim,

It is possible to use raw artificial neural networks by means of 
FeedForwardTrainer. It is [ml] package private, so your code should be in that 
package too. 
Basically, you need to do the same as it is done in 
MultilayerPerceptronClassifier but without encoding the output as one-hot: 
https://github.com/apache/spark/blob/master/mllib/src/main/scala/org/apache/spark/ml/classification/MultilayerPerceptronClassifier.scala#L168
Here is the sketch of the code if your outputs are continuous and are within 
[0, 1] interval:
val topology = FeedForwardTopology.multiLayerPerceptron(layers, useSoftMax = 
false)
val FeedForwardTrainer = new FeedForwardTrainer(topology, layers(0), 
layers.last)
val mlpModel = FeedForwardTrainer.train(data)

For the outputs in that are in the range of (-infinity, +infinity), the new 
loss function is needed. It is implemented but not merged in Spark yet, 
unfortunately:
https://github.com/avulanov/spark/tree/autoencoder-mlp

Best regards, Alexander

-----Original Message-----
From: Jim Carroll [mailto:jimfcarr...@gmail.com] 
Sent: Sunday, March 27, 2016 6:25 AM
To: user@spark.apache.org
Subject: Non-classification neural networks

Hello all,

We were using the old "Artificial Neural Network" :
https://github.com/apache/spark/pull/1290

This code appears to have been incorporated in 1.5.2 but it's only exposed 
publicly via the MultilayerPerceptronClassifier. Is there a way to use the old 
feedforward/backprop non-classification functionality? It appears to be buried 
in private classes and it's not obvious to me if the 
MultilayerPerceptronClassifier can be used without the classification. The doc 
says "Number of outputs has to be equal to the total number of labels." 

What if the output is continuous and you want to simply do prediction?

Thanks
Jim




--
View this message in context: 
http://apache-spark-user-list.1001560.n3.nabble.com/Non-classification-neural-networks-tp26604.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@spark.apache.org For additional 
commands, e-mail: user-h...@spark.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@spark.apache.org
For additional commands, e-mail: user-h...@spark.apache.org

Reply via email to