Conversation
swinter1
left a comment
There was a problem hiding this comment.
Looks good.
One optional thing - Do we want to address this TODO while we are here? "num_samples_total; this should probably define the number of samples to return, and then continue generating them" - I think this would be pretty quick to do?
I had that in a separate issue but I agree it makes sense to include it now. |
done |
|
Note: the docstring in importance_sampling.py will be improved in PR 123. |
….com/dnv-opensource/axtreme into 97_test_importance_sampling_creation
am-kaiser
left a comment
There was a problem hiding this comment.
looks great! I only had one comment
| mask = pdf > threshold | ||
| samples = samples[mask] | ||
| while samples_collected < num_samples_total: | ||
| # Draw a batch of proposals |
There was a problem hiding this comment.
You run into the danger of having an infinite loop here, i.e. if env_distribution_pdf never returns values > threshold you’ll loop forever. Suggested solution: add a max proposals/trials limit and raise a clear error if nothing is accepted.
Main issue:
Closes #97
Sub issues: