def facc(label, pred):
    """ evaluate accuracy """
    pred = pred.ravel()
    label = label.ravel()
    return ((pred > 0.5) == label).mean()
def facc ( label , pred ) : pred = pred . ravel ( ) label = label . ravel ( ) return ( ( pred > 0.5 ) == label ) . mean ( )
evaluate accuracy