Building a deep belief network

In this section, we'll build a deep belief network (DBN) based on the RBM, as shown in the following diagram. The network consists of four layers. The first layer recedes the 748 inputs to 500 neurons, then to 250, followed by 200, and finally to the last 10 target values:

As the code is the same as in the previous example, let's take a look at how to configure such a network:

MultiLayerConfiguration conf = new    NeuralNetConfiguration.Builder() 

We will define the gradient optimization algorithm, as shown in the following code:

 .seed(seed) .gradientNormalization( GradientNormalization.ClipElementWiseAbsoluteValue) ...

Get Machine Learning in Java - Second Edition 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.