February 2018
Intermediate to advanced
262 pages
6h 59m
English
We will use the same fit function that we have been using from Chapter 5, Deep Learning for Computer Vision. I am not including that here, to save space. The following code snippet contains functionality to train the model and shows the results:
train_losses , train_accuracy = [],[]val_losses , val_accuracy = [],[]for epoch in range(1,10): epoch_loss, epoch_accuracy = fit(epoch,fc,trn_feat_loader,phase='training') val_epoch_loss , val_epoch_accuracy = fit(epoch,fc,val_feat_loader,phase='validation') train_losses.append(epoch_loss) train_accuracy.append(epoch_accuracy) val_losses.append(val_epoch_loss) val_accuracy.append(val_epoch_accuracy)
The result of the preceding code is as follows:
#Resultstraining ...