The output layer design is the last step in configuring the neural network layer. Our aim is to implement a time series prediction model. We need to develop a time series classifier to predict patient mortality. The output layer design should reflect this purpose. In this recipe, we will discuss how to construct the output layer for our use case.
Constructing output layers for the network
How to do it...
- Design the output layer using RnnOutputLayer:
new RnnOutputLayer.Builder(LossFunctions.LossFunction.MCXENT)
.activation(Activation.SOFTMAX)
.nIn(LSTM_LAYER_SIZE).nOut(labelCount).build()
- Use the addLayer() method to add an output layer to the network configuration:
builder.addLayer("predictMortality", new RnnOutputLayer...