Source code for signxai.tf_signxai.methods_impl.signed
import numpy as np
[docs]
def calculate_sign_mu(x, mu=None, vlow=-1, vhigh=1, **kwargs):
    assert vlow < vhigh
    s = np.array(x)
    if mu is None:
        mu = vlow + (abs(vhigh - vlow) / 2.0)
    s[s < mu] = vlow
    s[s >= mu] = vhigh
    return s