I am trying it make a sudoku solver using CNNs. So I need to output 81 values (between 1 and 9, 0 is empty) and calculate 81 losses. How would I handle that? I know you can easily do this for two or three outputs but is there a more convenient way than the way outlined here A model with multiple outputs 1 . Also, what would be the best cost function to use? I am using a resnet based architecture.