Caffe python layer to print confusion matrix

To view the confusion matrix and the accuracy of a neural network while it is being trained, I coded this easy python layer to print the confusion matrix while training a model with Caffe.