-
Notifications
You must be signed in to change notification settings - Fork 12
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
Feature/samples summary in result #981
Conversation
median_pdf_sample = Sample.from_lists( | ||
model=self.model, | ||
parameter_lists=[self.median_pdf(as_instance=False)], | ||
log_likelihood_list=[self.max_log_likelihood_sample.log_likelihood], | ||
log_prior_list=[self.max_log_likelihood_sample.log_prior], | ||
weight_list=[self.max_log_likelihood_sample.weight], | ||
)[0] |
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.
Seems silly to use a function called 'from_lists' only to take the first item
I guess it makes a lot of sense for Result to take Paths; it starts to look a lot like the SearchOutput class used by the agregator. What happens when a search has no name? |
# sample_list=samples_with_log_likelihood_list( | ||
# self.sample_multiplier * fit, _make_samples(model) | ||
# ), |
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.
Commented code
if self._samples is not None: | ||
return self._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.
Could use cached_property
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.
Not quite, this is because samples can be passed into __init__
meaning we dont load via csv (e.g. to avoid I/O)
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.
Ah ofc
try: | ||
Samples.from_csv( | ||
paths=self.paths, | ||
model=self.model, | ||
) | ||
except FileNotFoundError: | ||
pass |
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.
Should the return type be Optional?
Make it so that all internal results loading use the
SamplesSummary
object instead of theSamples
object wherever possible.This has two benefits:
-Loading
samples.csv
/search_internal.dill
in order to load results when resuming a model-fit was very slow.output.yaml
mean autofit can now run without outputting asamples.csv
file orsearch_internal.dill
file at all (to save hard disk space). The samples summary file cannot be customized to not be output, meaning the information for resuming runs is always available.This is motivated for search chaining prior passing, which by using the
SamplesSummary
resumes previous fits much faster.