Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: clip_evals uses wrong indicator #3227

Open
josef-pkt opened this issue Oct 5, 2016 · 0 comments · May be fixed by #3716
Open

BUG: clip_evals uses wrong indicator #3227

josef-pkt opened this issue Oct 5, 2016 · 0 comments · May be fixed by #3716

Comments

@josef-pkt
Copy link
Member

def clip_evals(x, value=0): #threshold=0, value=0):
    evals, evecs = np.linalg.eigh(x)
    clipped = np.any(evals < 0)
    x_new = np.dot(evecs * np.maximum(evals, value), evecs.T)
    return x_new, clipped

we are clipping based on value and not necessarily at 0
clipped = np.any(evals < value)

this is used as indicator in the functions to see whether clipping was necessary. So, that's incorrect if threshold (value) != 0.
(in examples, value was still tiny like 1e-15, IIRC, just to get positive definiteness. So there is a small imprecision in the results because of this bug)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant