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

Update no-U-turn criteria and added some unit tests #91

Merged
merged 51 commits into from
Aug 19, 2019
Merged

Conversation

xukai92
Copy link
Member

@xukai92 xukai92 commented Aug 16, 2019

src/trajectory.jl Outdated Show resolved Hide resolved
src/trajectory.jl Outdated Show resolved Hide resolved
Copy link
Member

@yebai yebai left a comment

Choose a reason for hiding this comment

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

Great work - looks correct to me! I have left some minor comments above.

@xukai92
Copy link
Member Author

xukai92 commented Aug 19, 2019

Thanks for your review. I resolved most of the comments and left some replies to those I have questions. Please take a look.

@yebai
Copy link
Member

yebai commented Aug 19, 2019

Thanks for your review. I resolved most of the comments and left some replies to those I have questions. Please take a look.

Perhaps rename FullBinaryTree ==> BinaryTree for brevity? Also, it can be a bit confusing to include Full in the type name here, since it indicates that we store the full tree including internal nodes, which we don't in fact.

@xukai92
Copy link
Member Author

xukai92 commented Aug 19, 2019

Perhaps rename FullBinaryTree ==> BinaryTree for brevity? Also, it can be a bit confusing to include Full in the type nam

Sure. Let me do this.

src/trajectory.jl Outdated Show resolved Hide resolved
@yebai
Copy link
Member

yebai commented Aug 19, 2019

Actually, after seeing the new commits, I think TrajectoryMultinomialSampler and TrajectorySliceSampler are more accurate names than XTrajectorySampler. What do you think?

Also, seems that some tests are not updated to the new type names: https://travis-ci.org/TuringLang/AdvancedHMC.jl/jobs/573887417#L754

@xukai92
Copy link
Member Author

xukai92 commented Aug 19, 2019

I just fixed the tests.

The thing I like ?TrajectorySampler over Trajectory?Sampler is because it's a subtype of AbstractTrajectorySampler. But I'm OK with both. In fact I think only Slice or Multonomial would be fine. They are a subtype of AbstractTrajectorySampler anyway.

@yebai
Copy link
Member

yebai commented Aug 19, 2019

In fact I think only Slice or Multonomial would be fine. They are a subtype of AbstractTrajectorySampler anyway.

I'm happy with Slice and Multonomial too. But if we want to be a bit explicit, I think Trajectory?Sampler is a bit more self-explanatory.

@xukai92
Copy link
Member Author

xukai92 commented Aug 19, 2019

Let's go for the Slice and Multonomial for now. They are use for constructing NUTS (or other trajectories) ATM so I guess it's fine and looks clean.

@yebai yebai changed the title Update no-U-turn criteria Update no-U-turn criteria and added some unit tests Aug 19, 2019
@xukai92
Copy link
Member Author

xukai92 commented Aug 19, 2019

I'm happy to merge it if no rejections.

@yebai yebai merged commit 26aabb5 into master Aug 19, 2019
@delete-merged-branch delete-merged-branch bot deleted the kx/update-isuturn branch August 19, 2019 17:18
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