Computer Vision News - December 2020
The most common class label is extracted from the list (in the current cell scope) and placed into the following matrix: The 40 x 40 matrix label_map has the value of -1 if no data items are associated with the cell, or a value 0, 1 or 2 which indicates the most common class label associated with the cell. Now the reduced dimensionality matrix can be displayed: The 4 arguments passed to the function get_cmap() take into account the four colors (as it’s also displayed previously). Those are one for each class and the extra color to show that there’s no association with any. Finale! There are many possibilities to explore using SOMs. Exploring hyper-parameters, using implementations with the fast.ai library (there is a nice article written by Ricardo Sayn on that) and more. Most importantly, even if they are not used for a real-life scenario, SOMs are a great way to define strategies, use neighborhood functions and explore dimensionality reduction! See you next month! :) 15 Self-Organizing Maps (SOMs) with PyTorch label_map = np.zeros(shape=(rows, cols), dtype=np.int) for i in range(rows): for j in range(cols): label_map[i][j] = most_common(mapping[i][j], 3 ) plt.imshow(label_map, cmap=plt.cm.get_cmap('terrain_r', 4 )) plt.colorbar() plt.show() if __name__=="__main__": main() "Meet a Rockstar on page 44!!!"
Made with FlippingBook
RkJQdWJsaXNoZXIy NTc3NzU=