Skip to content

Conversation

@js-d
Copy link

@js-d js-d commented Aug 18, 2020

Library for particle samplers in Turing.

@js-d js-d mentioned this pull request Aug 18, 2020
Copy link
Member

@devmotion devmotion left a comment

Choose a reason for hiding this comment

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

Great effort!

Unfortunately, I feel a bit uncomfortable reviewing this PR since I don't believe I'm able to spot any regressions or bugs possibly introduced here. I'm not sure on which state of the Turing particle samplers this PR is based, in particular I'm wondering if all recent bug fixes are included (see, e.g., TuringLang/Turing.jl#1345).

It also seems that the files are not just copied from the Turing repo since the formatting of most docstring seems to be incorrect. This should be fixed.

Project.toml Outdated
Comment on lines 1 to 14
name = "AdvancedPS"
uuid = "9c00393c-822d-4781-8df5-4c3c33f9866d"
authors = ["JS Denain <denain.js@gmail.com>"]
version = "0.1.0"

[deps]
AbstractMCMC = "80f14c24-f653-4e6a-9b94-39d6b0f70001"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
DynamicPPL = "366bfd00-2699-11ea-058f-f148b4cae6d8"
Libtask = "6f1fad26-d15e-5dc8-ae53-837a1d7b8c9f"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
StatsFuns = "4c63d2b9-4356-54db-8cca-17b64c39e42c"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Turing = "fce5fe82-541a-59a6-adf8-730c64b5f9a0"
Copy link
Member

Choose a reason for hiding this comment

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

The Manifest.toml file should be removed and Project.toml should be cleaned: test dependencies have to be moved to a separate section (e.g., this package shouldn't depend on Test or Turing, and probably also not on DynamicPPL), and compatibility bounds have to be specified.

Copy link
Author

@js-d js-d Aug 18, 2020

Choose a reason for hiding this comment

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

By 'moved to a separate section', do you mean having an [extras] section in Project.toml and a [target] section containing the line test = [<list of packages>]?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, exactly 👍




# AdvancedPS.jl
Copy link
Member

Choose a reason for hiding this comment

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

Why are the references removed?

Copy link
Author

Choose a reason for hiding this comment

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

my bad, changed

end

"""
reset_logweights!(pc::ParticleContainer)
Copy link
Member

Choose a reason for hiding this comment

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

Copying messed up the docstrings.

Comment on lines 13 to 16
@test sum(resSystematic .== 2) (num_samples * 0.4) atol=1e-3*num_samples
@test sum(resStratified .== 2) (num_samples * 0.4) atol=1e-3*num_samples
@test sum(resMultinomial .== 2) (num_samples * 0.4) atol=1e-2*num_samples
@test sum(resResidual .== 2) (num_samples * 0.4) atol=1e-2*num_samples
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
@test sum(resSystematic .== 2) (num_samples * 0.4) atol=1e-3*num_samples
@test sum(resStratified .== 2) (num_samples * 0.4) atol=1e-3*num_samples
@test sum(resMultinomial .== 2) (num_samples * 0.4) atol=1e-2*num_samples
@test sum(resResidual .== 2) (num_samples * 0.4) atol=1e-2*num_samples
@test count(==(2), resSystematic) 0.4 * num_samples 0.4atol=1e-3*num_samples
@test count(==(2), resStratified) 0.4 * num_samples atol=1e-3*num_samples
@test count(==(2), resMultinomial) 0.4 * num_samples atol=1e-2*num_samples
@test count(==(2), resResidual) 0.4 * num_samples atol=1e-2*num_samples

Why are the different tolerances needed BTW?

@cpfiffer
Copy link
Member

I share @devmotion's concern that it's hard to review this. Could we basically just copy all the Turing code first in a separate PR, merge that through first, and then use the new master to compare the changes made as part of this PR?

@js-d
Copy link
Author

js-d commented Aug 18, 2020

AdvancedPS here is supposed to work with the Turing samplers introduced in this PR.
I don't think it addresses the issues in TuringLang/Turing.jl#1345.

@cpfiffer
Copy link
Member

Yeah, that's fine -- it's just difficult to examine the changes because all the code here is "new" to AdvancedPS.jl, so we can't review changes that might be a bad idea because there's nothing to compare to.

This was referenced Nov 30, 2020
@yebai
Copy link
Member

yebai commented Dec 11, 2020

Close in favour of #14

@yebai yebai closed this Dec 11, 2020
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.

4 participants