Gradient-Based Monitoring of Learning Machines