-
Notifications
You must be signed in to change notification settings - Fork 116
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
New interface for sampling #300
base: develop
Are you sure you want to change the base?
Conversation
5bb3dd7
to
9be4f78
Compare
906e119
to
f1abc36
Compare
…tribution. Added support for basic uniform samplers.
…tribution. Added support for gaussian and exponential distributions
…tribution. Added support for logconcave distributions (reflected hmc & nuts samplers)
…tribution. Added support for logconcave distributions (crhmc)
7ffa98c
to
99cbba6
Compare
|
||
auto accelerated_billiard_walk(HPolytopeType& HP, RNGType& rng, unsigned int walk_len, unsigned int num_points) | ||
{ | ||
typedef RandomPointGenerator<AcceleratedBilliardWalkType> Generator; |
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.
Do we need this line here?
//HP.print(); | ||
//std::cout<<"\n"; |
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.
Shall we delete them?
|
||
auto start = std::chrono::steady_clock::now(); | ||
|
||
sample_points<64>(HP, q, walk, distr, rng, walk_len, rnum, nburns, samples); |
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.
What is 64?
|
||
Point p = starting_point; | ||
|
||
//TODO: burnin for nuts |
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.
Why burnin is difficult for nuts?
template <typename NT> | ||
static NT compute(HPolytope<Point> const& P) | ||
{ | ||
return NT(2) * std::sqrt(NT(P.dimension())) * P.InnerBall().second; |
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.
I think we should call ComputeInnerBall() from the Polytope.
We have a flag in Hpolytope that checks if the innerball is already computed in ComputeInnerBall().
If the ball isn't computed then InnerBall() will trigger a runntime error.
I would probably add a todo to do the same check in InnerBall() as well and if the ball is not computed then we call ComputeInnerBall() in InnerBall(). Or we could delete InnerBall() and rename the ComputeInnerBall() to InnerBall().
@@ -346,7 +346,7 @@ struct AcceleratedBilliardWalk | |||
pointset.push_back(_p); | |||
NT rad = NT(0), max_dist, Lmax = get_delta(), radius = P.InnerBall().second; |
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.
Plz call ComputeInnerBall() (see my previous comment)
{ | ||
MT A = P.get_mat(); | ||
VT b = P.get_vec(), _vec_point = VT::Zero(P.dimension()), p0 = p.getCoefficients(); | ||
NT r = P.ComputeInnerBall().second; | ||
NT r = P.InnerBall().second; |
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.
Plz call ComputeInnerBall() (see my previous comment)
{ | ||
MT A = P.get_mat(); | ||
VT b = P.get_vec(), _vec_point = VT::Zero(P.dimension()), p0 = p.getCoefficients(); | ||
NT r = params.set_L ? params.m_L | ||
: P.ComputeInnerBall().second; | ||
: P.InnerBall().second; |
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.
Plz call ComputeInnerBall() (see my previous comment)
{ | ||
MT A = P.get_mat(); | ||
VT b = P.get_vec(), _vec_point = VT::Zero(P.dimension()), p0 = p.getCoefficients(); | ||
NT r = P.ComputeInnerBall().second; | ||
NT r = P.InnerBall().second; |
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.
Plz call ComputeInnerBall() (see my previous comment)
{ | ||
MT A = P.get_mat(); | ||
VT b = P.get_vec(), _vec_point = VT::Zero(P.dimension()), p0 = p.getCoefficients(); | ||
NT r = params.set_L ? params.m_L | ||
: P.ComputeInnerBall().second; | ||
: P.InnerBall().second; |
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.
Plz call ComputeInnerBall() (see my previous comment)
{ | ||
MT A = P.get_mat(); | ||
VT b = P.get_vec(), _vec_point = VT::Zero(P.dimension()), p0 = p.getCoefficients(); | ||
NT r = P.ComputeInnerBall().second; | ||
NT r = P.InnerBall().second; |
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.
Plz call ComputeInnerBall() (see my previous comment)
{ | ||
MT A = P.get_mat(); | ||
VT b = P.get_vec(), _vec_point = VT::Zero(P.dimension()), p0 = p.getCoefficients(); | ||
NT r = params.set_L ? params.m_L | ||
: P.ComputeInnerBall().second; | ||
: P.InnerBall().second; |
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.
Plz call ComputeInnerBall() (see my previous comment)
Function is parameterized by walk and distribution. Added support for
basic uniformall samplers.