At test time the PReLU-net does not crop the image into views. It runs the convolution layers once on the whole resized image, slides a fixed-size window over the last feature map, pools every window with spatial pyramid pooling, scores it with the fully connected classifier, and averages the scores. This is repeated for a horizontally flipped copy and for several image scales. Implement the scoring part, given the feature maps.
dense_view_scores(fmaps, fc_w, fc_b, window, levels=(7, 3, 2, 1), k=5) -> (scores, top)
fmaps: list of float arrays of shape (C, H_m, W_m); each is the last conv feature map of one scale or one flipped copy. Sizes may differ.fc_w: array (K, D) with ; fc_b: array (K,). The classifier is .window: window side in feature-map cells. For a map of height and width the window is with , , and it slides with stride 1, giving windows.(C, n, n) block in channel, row, column order and concatenate the levels in the given order.scores is the mean of the map scores, each map counting equally: a float NumPy array of shape (K,).top: list of the k class indices with the highest scores, highest first; ties go to the lower index. Assume .