June 2018
Intermediate to advanced
436 pages
10h 33m
English
The scoring approach that we are going to use is simple. It assigns business-level labels by averaging the image-level predictions. I did this in a simplistic manner, but you can try using a better approach. What I did is assign a business as label 0 if the average of the probabilities across all of its images belonging to class 0 are greater than a certain threshold, say, 0.5:
public static INDArray scoreModel(MultiLayerNetwork model, INDArray ds) { return model.output(ds); }
Then, I collected the model predictions from the scoreModel() method and merged them with alignedData:
/** Take model predictions from scoreModel and merge with alignedData*/public static List<Pair<String, Double>> aggImgScores2Business(INDArray scores, ...
Read now
Unlock full access