As a final step, we need to decode the data back from the encoded state. Are we able to reconstruct the input just the way it is? If yes, then it's all good. Otherwise, we need to calculate an associated reconstruction error. Remember that the incoming connections to the output layer should be the same as the outgoing connections from the preceding layer.
Constructing output layers
How to do it...
- Create an output layer using OutputLayer:
OutputLayer outputLayer = new OutputLayer.Builder().nIn(250).nOut(784)
.lossFunction(LossFunctions.LossFunction.MSE)
.build();
- Add OutputLayer to the layer definitions:
builder.layer(new OutputLayer.Builder().nIn(250).nOut(784)
.lossFunction(LossFunctions.LossFunction.MSE)
.build...