-
Notifications
You must be signed in to change notification settings - Fork 34
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
Find out why adaptive covariance func test results have changed slightly #784
Comments
Investigating this is made a bit harder by the fact that I removed the studies that time, which changed a lot of old commit hashes :-| |
So I've added some functionality to
on scrambler |
|
This seems to say the bug is between these two commits:
But I can't really see how that would be the case... |
Aha! This is getting very interesting. The change happens when the merge occurs. But we can't just go back down the list of commits chronologically because then commits from |
So some of the "noise" we see before the final jump is the cause, not the final jump! |
So we aren't just testing the master branch but all commits? |
Sorry this got a bit weird. We're testing only master. But, when you merge something into master, the ordering of commits in time gets a bit weird. So what I was doing here was not using normal functional testing, but scanning back in time over master, trying to find out exactly where a change happens. It turns out now that that's a bit harder than I thought, because you can't just order all the previous commits by time. So in the above statement, the merge commit (top) is definitely what caused the change, but the commit below isn't necessarily the culprit |
This is another candidate for the change we're seeing |
I miss SVN! |
OK, think the difference arises here:
|
We used to have
but then it became this:
where
|
Yep, think I made those changes after I noticed an error in the previous
calculation (where the first component of _sigma wasn't 100) or something.
…On Thu, Apr 25, 2019 at 10:10 AM Michael Clerx ***@***.***> wrote:
We used to have
# Calculate the Kullback-Leibler divergence between the given samples
# and the multivariate normal distribution underlying this banana.
# From wikipedia:
#
# k = dimension of distribution
# dkl = 0.5 * (
# trace(s1^-1 * s0)
# + (m1 - m0)T * s1^-1 * (m1 - m0)
# + log( det(s1) / det(s0) )
# - k
# )
#
# For this distribution, s1 is the identify matrix, and m1 is zero,
# so it simplifies to
#
# dkl = 0.5 * (trace(s0) + m0.dot(m0) - log(det(s0)) - k))
#
m0 = np.mean(y, axis=0)
s0 = np.cov(y.T)
return 0.5 * (
np.trace(s0) + m0.dot(m0)
- np.log(np.linalg.det(s0)) - self._n_parameters)
but then it became this:
# Calculate the Kullback-Leibler divergence between the given samples
# and the multivariate normal distribution underlying this banana.
# From wikipedia:
#
# k = dimension of distribution
# dkl = 0.5 * (
# trace(s1^-1 * s0)
# + (m1 - m0)T * s1^-1 * (m1 - m0)
# + log( det(s1) / det(s0) )
# - k
# )
#
# For this distribution, s1 is the identify matrix, and m1 is zero,
# so it simplifies to
#
# dkl = 0.5 * (trace(s0) + m0.dot(m0) - log(det(s0)) - k))
#
m0 = np.mean(y, axis=0)
s0 = np.cov(y.T)
s1 = self._sigma
m1 = np.zeros(self.n_parameters())
s1_inv = np.linalg.inv(s1)
return 0.5 * (
np.trace(np.matmul(s1_inv, s0)) +
np.matmul(np.matmul(m1 - m0, s1_inv), m1 - m0) -
np.log(np.linalg.det(s0)) +
np.log(np.linalg.det(s1)) -
self._n_parameters)
where
self._sigma = np.eye(self._n_parameters)
self._sigma[0, 0] = 100
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#784 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABCILKFVEJABFJ4B2EIWEETPSFYQFANCNFSM4HGJWYMA>
.
|
There's a (m1 - m0) transpose in the wiki equation I don't see in the code - will check if that matters - but otherwise looks good to me |
Yeah it's a vector so the transpose doesn't matter. Have stuck it in anyway and adapted the comment above. Would be good if someone could review quickly! |
Checked other "new" fails in functional tests, and they're all banana tests, from the same commit. So this is definitely what we're seeing |
Double-checked the paper and agree we now have the banana distribution correct |
Conclusion: Not a bug! We just made the problem harder. Footnote about versioning: When you use branches and merge them, your history isn't linear - it's got branches after all! So you have to be careful when interpreting a linearised view of your history. (Not a git-specific thing it turns out Gary ;-) |
Wondering now whether to delete the test results from before this change. Thoughts @martinjrobins @ben18785 ? |
We need a general method to mark (and ignore) false failures. Should be
easy to run, but happy to go with the delete option for now untill we
figure it out
…On Thu, 25 Apr 2019, 11:26 Michael Clerx, ***@***.***> wrote:
Wondering now whether to delete the test results from before this change.
Thoughts @martinjrobins <https://github.com/martinjrobins> @ben18785
<https://github.com/ben18785> ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#784 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAIYL5GIQL2TGQLQY3DHVH3PSGBO3ANCNFSM4HGJWYMA>
.
|
As part of #780 I imagine we'd have some sort of "known good result" marker indicating where the region whose distribution to estimate starts. We could plot a nice line for this in the graph... Actually, @chonlei might already need that line as part of #783 |
And emcee hammer
My current guesses:
The text was updated successfully, but these errors were encountered: