import org.deeplearning4j.nn.multilayer.MultiLayerNetwork; import org.deeplearning4j.nn.conf.NeuralNetConfiguration; import org.deeplearning4j.nn.conf.layers.DenseLayer; import org.deeplearning4j.nn.conf.layers.OutputLayer; import org.deeplearning4j.optimize.listeners.ScoreIterationListener; import org.nd4j.linalg.activations.Activation; import org.nd4j.linalg.lossfunctions.LossFunctions; public class AIExample { public static void main(String[] args) { MultiLayerNetwork model = new MultiLayerNetwork(new NeuralNetConfiguration.Builder() .list() .layer(0, new DenseLayer.Builder().nIn(784).nOut(32).activation(Activation.RELU).build()) .layer(1, new OutputLayer.Builder(LossFunctions.LossFunction.NEGATIVELOGLIKELIHOOD) .activation(Activation.SOFTMAX) .nOut(10).build()) .build()); model.init(); model.setListeners(new ScoreIterationListener(100)); } }