O'Reilly logo

Java Deep Learning Projects by Md. Rezaul Karim

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

LSTM network construction

As discussed in the Titanic survival prediction section, again everything starts with MultiLayerConfiguration, which organizes those layers and their hyperparameters. Our LSTM network consists of five layers. The input layer is followed by three LSTM layers. Then the last layer is an RNN layer, which is also the output layer.

More technically, the first layer is the input layer, and then three layers are placed as LSTM layers. For the LSTM layers, we initialized the weights using Xavier. We use SGD as the optimization algorithm with Adam updater and the activation function is tanh.

Finally, the RNN output layer has a softmax activation function, which gives us a probability distribution over classes (that is, outputs ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required