CNN distributed training with Spark and DL4J

Let's get back to the example that has been presented in Chapter 5, Convolutional Neural Networks, Hands-on CNN with Spark, about handwritten digits image classification on the MNIST dataset. For convenience, here's a reminder of the network configuration used there:

val channels = 1 val outputNum = 10 val conf = new NeuralNetConfiguration.Builder()     .seed(seed)     .iterations(iterations)     .regularization(true)     .l2(0.0005)     .learningRate(.01)     .weightInit(WeightInit.XAVIER)     .optimizationAlgo(OptimizationAlgorithm.STOCHASTIC_GRADIENT_DESCENT)     .updater(Updater.NESTEROVS)     .momentum(0.9)     .list     .layer(0, new ConvolutionLayer.Builder(5, 5)         .nIn(channels)         .stride(1, 1)         .nOut(20) .activation(Activation.IDENTITY) ...

Get Hands-On Deep Learning with Apache Spark now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.