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

Modifies implementation of expected_loglik and add tests for it #93

Merged
merged 14 commits into from
Jan 19, 2022

Conversation

theogf
Copy link
Member

@theogf theogf commented Jan 11, 2022

This addresses the discussions in #82 by implementing @devmotion and adding tests for Zygote compatibility.
It adds a dependency on IrrationalConstants which was already there implicitly anyway.

src/expected_loglik.jl Show resolved Hide resolved
src/expected_loglik.jl Outdated Show resolved Hide resolved
src/expected_loglik.jl Outdated Show resolved Hide resolved
test/expected_loglik.jl Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jan 11, 2022

Codecov Report

Merging #93 (2b102de) into master (094bb40) will increase coverage by 0.09%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #93      +/-   ##
==========================================
+ Coverage   95.69%   95.78%   +0.09%     
==========================================
  Files           4        4              
  Lines         279      285       +6     
==========================================
+ Hits          267      273       +6     
  Misses         12       12              
Impacted Files Coverage Δ
src/expected_loglik.jl 95.34% <100.00%> (+0.75%) ⬆️

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 094bb40...2b102de. Read the comment docs.

@theogf
Copy link
Member Author

theogf commented Jan 11, 2022

I am not sure why, but the examples are unable to compile ApproximateGPs....

@theogf theogf requested review from st-- and devmotion January 11, 2022 17:26
src/expected_loglik.jl Outdated Show resolved Hide resolved
src/ApproximateGPs.jl Outdated Show resolved Hide resolved
src/expected_loglik.jl Outdated Show resolved Hide resolved
test/expected_loglik.jl Outdated Show resolved Hide resolved
src/expected_loglik.jl Outdated Show resolved Hide resolved
src/expected_loglik.jl Outdated Show resolved Hide resolved
test/expected_loglik.jl Outdated Show resolved Hide resolved
test/expected_loglik.jl Outdated Show resolved Hide resolved
test/expected_loglik.jl Outdated Show resolved Hide resolved
@theogf
Copy link
Member Author

theogf commented Jan 14, 2022

@st-- I addressed your comments and made one more change. Now there is also a "unit" expected_loglik for one observation and one q_f. This allows splitting the code more easily and allows to compute things for one observation as well.

Copy link
Member

@st-- st-- left a comment

Choose a reason for hiding this comment

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

According to your benchmarks in #82, not quite as fast as the old code, but I like how clean it is:)

src/expected_loglik.jl Outdated Show resolved Hide resolved
src/expected_loglik.jl Outdated Show resolved Hide resolved
test/sparse_variational.jl Outdated Show resolved Hide resolved
@theogf
Copy link
Member Author

theogf commented Jan 14, 2022

According to your benchmarks in #82, not quite as fast as the old code, but I like how clean it is:)

The speed is more or less the same but the allocations are massively different.

It would be good to compare gradients as well though. Although we could have a frule and rrule with the reparametrization trick :D

@st--
Copy link
Member

st-- commented Jan 14, 2022

It would be good to compare gradients as well though. Although we could have a frule and rrule with the reparametrization trick :D

Do you want to do that within this PR?

@theogf
Copy link
Member Author

theogf commented Jan 14, 2022

It would be good to compare gradients as well though. Although we could have a frule and rrule with the reparametrization trick :D

Do you want to do that within this PR?

No, I think it deserves a PR of its own

Copy link
Member

@st-- st-- left a comment

Choose a reason for hiding this comment

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

Can you please remove the atol 1e-6 -> 1e-5 change before merging it? Otherwise looks good to me.

@st-- st-- merged commit 9f258f8 into master Jan 19, 2022
@st-- st-- deleted the tgf/fix_expected_loglik branch January 19, 2022 10:02
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.

2 participants