Skip to content

Conversation

@junpenglao
Copy link
Member

@junpenglao junpenglao commented Jun 18, 2017

Related/same issue including: #2076, #2109

fix py2.7 float 32 test error
@junpenglao junpenglao requested a review from aseyboldt June 18, 2017 18:25
@junpenglao
Copy link
Member Author

junpenglao commented Jun 18, 2017

@aseyboldt I got something funny when testing, using the following code:

with pm.Model() as model:
    a = pm.Uniform('a', lower=0., upper=1.)
    pm.Uniform('b', lower=0., upper=a)
start = {'a': .7, 'b': .5}
pm.sampling._update_start_vals(start, model.test_point, model)
start

The value in start['b_interval__'] is incorrect (it changes every time the above is excuted), however if I do

    pm.Uniform('b', lower=0., upper=a-0.)

Then the value propagates correctly.
That's what I am currently doing in https://github.com/pymc-devs/pymc3/pull/2328/files#diff-2d8e65f96de72b3dad37dd6025425149R140

a, b = draw_values([self.a-0., self.b-0.],
                                 point=point)

but I feel like I am missing something obvious here... Do you know if there is a better way?

@twiecki
Copy link
Member

twiecki commented Jun 19, 2017

This LGTM. @junpenglao is the above issue resolved after your recent commit?

@junpenglao
Copy link
Member Author

junpenglao commented Jun 19, 2017

Yes, there is no issue anymore, it just the implementation is not very pretty and potentially confusing. Maybe I should put a comment to explain why, and a warning not to delete the minus 0.

@twiecki
Copy link
Member

twiecki commented Jun 19, 2017

Good idea.

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