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

fix Julia 1.7 tests #85

Merged
merged 6 commits into from
Dec 31, 2021
Merged

fix Julia 1.7 tests #85

merged 6 commits into from
Dec 31, 2021

Conversation

st--
Copy link
Member

@st-- st-- commented Dec 16, 2021

No description provided.

@willtebbutt
Copy link
Member

I'm a little bit confused as to why this improves type-stability. Do we have a global cache variable somewhere or something?

@st--
Copy link
Member Author

st-- commented Dec 22, 2021

Actually, I think the something() in the return line makes it type-stable already, the cache variable is only locally type-unstable (initialized as nothing, then overwritten with something). But I still think it's cleaner with nonlocal.

@st--
Copy link
Member Author

st-- commented Dec 22, 2021

Test failure is due to optimisation having ended up in a bad local optimum ...

@st-- st-- changed the title improve type stability improve type stability & fix Julia 1.7 tests Dec 23, 2021
@st-- st-- changed the title improve type stability & fix Julia 1.7 tests fix Julia 1.7 tests Dec 23, 2021
@willtebbutt
Copy link
Member

Test failure is due to optimisation having ended up in a bad local optimum ...

Hmmm that's weird. Shouldn't the optimisation problem be convex, since the likelihood is log-concave?

@st--
Copy link
Member Author

st-- commented Dec 23, 2021

Test failure is due to optimisation having ended up in a bad local optimum ...

Hmmm that's weird. Shouldn't the optimisation problem be convex, since the likelihood is log-concave?

The inner loop should be convex optimisation, but not the optimisation of hyperparameters using the approximate log marginal likelihood..

But yeah I don't understand why that would have changed so much in the 1.6 -> 1.7 change :S

@rossviljoen
Copy link
Collaborator

Might be because they changed the default RNG?

@codecov
Copy link

codecov bot commented Dec 24, 2021

Codecov Report

Merging #85 (4ad67e3) into master (a3db592) will decrease coverage by 0.64%.
The diff coverage is 50.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #85      +/-   ##
==========================================
- Coverage   90.78%   90.13%   -0.65%     
==========================================
  Files           4        4              
  Lines         282      294      +12     
==========================================
+ Hits          256      265       +9     
- Misses         26       29       +3     
Impacted Files Coverage Δ
src/laplace.jl 87.17% <50.00%> (+0.28%) ⬆️
src/utils.jl 33.33% <0.00%> (-33.34%) ⬇️
src/expected_loglik.jl 94.59% <0.00%> (+0.15%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 46067c3...4ad67e3. Read the comment docs.

@willtebbutt
Copy link
Member

I'm still a bit confused by the need for local. AFAICT, there's not a cache variable in the module-level scope of ApproximateGPs, so is the local keyword no a no-op? How would what we see differ if local were not used?

# The random number generator changed in 1.6->1.7. The following vector was generated in Julia 1.6.
# The generating code below is only kept for illustrative purposes.
#! format: off
Y = [0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't we just use rng=MersenneTwister() or whatever?

@rossviljoen
Copy link
Collaborator

@willtebbutt It's just a nicer way of initialising the variable no?

@willtebbutt
Copy link
Member

@willtebbutt It's just a nicer way of initialising the variable no?

🤦 you're right.

Copy link
Member

@willtebbutt willtebbutt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@st-- st-- merged commit df0010d into master Dec 31, 2021
@st-- st-- deleted the st/quickfix branch December 31, 2021 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants