loss computation. Adam is an optimization algorithm that can be used instead of the
based on training data. Figure
172
Now, you can start training the model using the training dataset to validate the
model at every step. Choose 32 as the batchsize and 20 epochs. The training process
outputs the loss and accuracy as well as the validation loss and validation accuracy at
each epoch. Figure
4-68
shows the code to train the model.
Figure 4-68. Code to train the model
Chapter 4 autoenCoders
173
Now that the training process is complete, let’s evaluate the model for loss and
accuracy. Figure
4-69
shows that the accuracy is 0.23. It also
shows the code to evaluate
the model.
The next step is to calculate the errors, and detect and also plot the anomalies and
the errors. Choose a threshold of 10. Figure
4-70
shows the code to predict the anomalies
based on the threshold.
Do'stlaringiz bilan baham: