Conversation
n3fit/src/n3fit/model_trainer.py
Outdated
| # different samples | ||
| else: | ||
| with open(params['hyperopt_res'], 'r') as file: | ||
| hyperopt_params = json.load(file) |
There was a problem hiding this comment.
| hyperopt_params = json.load(file) | |
| else: | |
| hyperopt_params = [params] |
|
This is a possible way to select and use the best trials : one should add in the runcard which will download the full If |
|
I like this approach a lot. I had a quick look and seems fine to me. I'll try to have a deeper look later and then we can merge. |
|
We should add a test, at least to the regressions, for this. Same runcard, two replicas. Something like that. And perhaps it would be wise to add to the |
| n_best = trial_specs['number_of_trials'] | ||
| best = hyperopt_dataframe[n_termalization:].sort_values('loss')[:n_best].to_dict(orient='list') | ||
| best['number_of_trials'] = n_best | ||
| return best |
There was a problem hiding this comment.
Since this is part of the config, it should use the loader (or the fallbackloader)
I'm unsure whether this should be here or in the validphys config though.
The other problem I see is that this is not seen by setupfit so if you send many jobs in parallel all of them will try to download the same thing to the same place, which can lead to a very bad crash (just happened to me in the cluster 😅)
There was a problem hiding this comment.
@scarlehoff does the last commit solve this issue?
There was a problem hiding this comment.
another maybe better option could be to do everything in vp config, create there the best trials and save a json file with them in the table folder or something. n3fit would then read it. Just like we do with stuff like thcovmat I guess. But how do I access output folders from the config to save the json file...?
There was a problem hiding this comment.
I guess since you went for the option of downloading a scan, I think it is fine not to save the json file (since the fit would be in the server anyway).
But then you need to make sure the parameters are in the json of each replica.
|
@scarlehoff thank you, I will have a go at your comments this afternoon |
Co-authored-by: Juan M. Cruz-Martinez <juacrumar@lairen.eu>
this PR should enable n3fit to produce a fit using different hyperparameters for each replica, taking as input the results of an hyperopt run. I think we need to