Search code examples
javaneural-networkclassificationdeeplearning4jencog

Basic deeplearning4j classification example


I need a very basic classification or similar example for deeplearning4j framework.

I have the classic training set in form of pairs of already normalized double arrays [0.01, 0.45, 0.0, ....] -> [0.0, 0.1, 0.0, 0.0, ...] and need to:

  1. Build and train a simple feedforward neural network with N hidden layers
  2. Feed a set of uncategorized double arrays to trained network and get a set of output vectors

Could somebody please share a basic and short example that does this?

UPD: Something like this but for deeplearning4j would really help.


Solution

  • Take a look at this example which shows how to train a nn on an XOR relationship. First you have to convert your doubles into ndarrays. To do this use the Nd4j.create(...) method. Then you need to set up a dataset like here.