Problem: I want to monitor my model better during training. Because in some cases the loss suddenly turn to nan during training, and I want to know what the model is doing when this happens. Besides that, I want to see if a certain layer obeys a specific condition (rows and columns should sum to one).
Approach:
Defining a custom metric wont help, since this one will only work on y_pred
and y_true
. Maybe there is some complex solution with building a model within a model, and trying to somehow calculate a metric on the output of the intermediate-model layer. But that feels a bit too complex.
Solution: The only thing I could think of otherwise is to switch to Tensorflow itself, so that I have more control over the training process. Any other ideas?