-
Notifications
You must be signed in to change notification settings - Fork 1
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
Enable choosing the fit strategy #182
Conversation
Pull Request Test Coverage Report for Build 10288140451Details
💛 - Coveralls |
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.
Looks good. But then you also need to update the OSG submitter.
@dachengx I only modified the submitter base class since all other submitters will parse additional arguments to the base class or am I missing something? Unfortunately, I can't test this behaviour though. |
@dachengx at least on midway this seems to be working fine. Any reason why it shouldn't work for the osg submitter? Maybe also @FaroutYLq can have a quick look 😊 |
After some internal discussions, we decided that the standard behavior should be that the strategy is defined in the config file of the statistical model and that it can be overwritten by values in the runner. I added this functionality now i.e. runner fit strategy > stat. model fit strategy > default fit strategy. |
What's the issue?
In the past, we observed that sometimes, and under certain conditions, minuit might not find a "valid" minimum for the fit. There are a few different solutions to this issue:
What does this PR add?
In this PR, we enable choosing a fit strategy. For this, we add
_fit_strategy
attribute to theStatisticalModel
class, which is used in thefit()
andconfidence_interval()
method if not specified otherwise.The
_fit_strategy
is a dictionary with the following entries:minimizer_routine
(Default:"migrad"
)minuit_strategy
(Default:1
)refit_invalid
(Default:True
)simplex_migrad
routine and strategy2
if the optimization does not converge the first time.disable_index_fitting
(Default:False
)max_index_fitting_iter
(Default:10
)The last two are not new but were direct arguments of the
fit
method before.There are a few ways to override the defaults on different levels:
fit_strategy
with all/some overrides to your running config file and the strategy will be used for every computation of the runnerfit_strategy
dict.How does the default behavior change?
The only difference in the default behavior is that invalid minima are now refit by default, which was not possible before. So far, the Minuit strategy was not specified and the Minuit default of 1 was used, which is the default also now. Also, the standard minimizer routine remains
migrad
as before.