August 2019
Intermediate to advanced
242 pages
5h 45m
English
At the end of our training, we should pit our model against the test set.
First, we should import our test data as follows:
if inputs, targets, err = cifar.Load("test", loc); err != nil { log.Fatal(err)}
Then, we need recalculate our batches as the test set is sized differently from the train set:
batches = inputs.Shape()[0] / bsbar = pb.New(batches)bar.SetRefreshRate(time.Second)bar.SetMaxWidth(80)
We then need to just add a quick way to track our results and output our results for later inspection by inserting the following code into the accuracy metric calculation code described earlier in the chapter:
// slices to store our outputvar testActual, testPred []int// store our output into the slices within the looptestActual ...
Read now
Unlock full access