Apply hierarchy constraints via max-pooling over descendants (MCM)
Source:R/loss.R
get_constr_output.RdGiven neural network outputs x and ancestor matrix R, enforces that
if a class is predicted positive, all its ancestors must also be positive.
Implements: final_out[i] = max{x[j] : R[i,j] = 1}