-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove in-place updates and fix return values (#64)
* Remove in-place updates and fix return values * Bump version * Fix format * added tests for all ADs * test - just sample 2 observations single-threaded * fix format with empty line * remove rdcache * updating jose's email in Project.toml * Update Project.toml * oops @Assert is actually @test * see if tests passes without Tracker * removed zygote also to see if tests passes Co-authored-by: Jose Storopoli <[email protected]>
- Loading branch information
Showing
5 changed files
with
72 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
name = "TuringGLM" | ||
uuid = "0004c1f4-53c5-4d43-a221-a1dac6cf6b74" | ||
authors = ["Jose Storopoli <[email protected]>, Rik Huijzer <[email protected]>, and contributors"] | ||
version = "2.1.1" | ||
authors = ["Jose Storopoli <[email protected]>, Rik Huijzer <[email protected]>, and contributors"] | ||
version = "2.1.2" | ||
|
||
|
||
[deps] | ||
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
@timed_testset "ad_backends" begin | ||
DATA_DIR = joinpath("..", "data") | ||
cheese = CSV.read(joinpath(DATA_DIR, "cheese.csv"), DataFrame) | ||
f = @formula(y ~ (1 | cheese) + background) | ||
m = turing_model(f, cheese) | ||
# only running 2 samples to test if the different ADs runs | ||
@timed_testset "ForwardDiff" begin | ||
Turing.setadbackend(:forwarddiff) | ||
chn = sample(m, NUTS(), 2) | ||
@test chn isa Chains | ||
end | ||
# TODO: fix Tracker tests | ||
# @timed_testset "Tracker" begin | ||
# using Tracker | ||
# Turing.setadbackend(:tracker) | ||
# chn = sample(m, NUTS(), 2) | ||
# @test chn isa Chains | ||
# end | ||
# TODO: fix Zygote tests | ||
# @timed_testset "Zygote" begin | ||
# using Zygote | ||
# Turing.setadbackend(:zygote) | ||
# chn = sample(m, NUTS(), 2) | ||
# @test chn isa Chains | ||
# end | ||
@timed_testset "ReverseDiff" begin | ||
using ReverseDiff | ||
Turing.setadbackend(:reversediff) | ||
chn = sample(m, NUTS(), 2) | ||
@test chn isa Chains | ||
end | ||
# go back to defaults | ||
Turing.setadbackend(:forwarddiff) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7631232
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register()
7631232
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registration pull request created: JuliaRegistries/General/67851
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:
Also, note the warning: Version 2.1.2 skips over 2.1.1
This can be safely ignored. However, if you want to fix this you can do so. Call register() again after making the fix. This will update the Pull request.