Closed Jammy2211 closed 2 years ago
The first issue I have hit is when I load a set of grid search results which are unfinished (e.g. with completed_only=False
) the initial aggregator works as expected (e.g., if I swap completed_only=True
the length of the aggregator decreases by 1, because it no longer has the grid search result).
However, the following line which I use to filter out all results except the grid search returns an aggregator with a length of 0:
agg_grid_searches = agg.grid_searches()
This works fine when the grid search is complete.
grid_search_result = list(agg_grid_searches)[0]['result']
print(grid_search_result.best_result)
Gives the following error:
File "database/directory/grid_search.py", line 157, in <module>
print(grid_search_result.best_result)
File "/mnt/c/Users/Jammy/Code/PyAuto/PyAutoFit/autofit/non_linear/grid/grid_search/result.py", line 157, in best_result
or result.log_likelihood > best_result.log_likelihood
TypeError: '<' not supported between instances of 'float' and 'NoneType'
As does the following line, which surprises me given that it does not directly use the best_result
:
print(grid_search_result.log_evidences_native)
How are you getting this? I can't seem to replicate it
I am running the following script and ctrl + c'ing half way through the grid search and commenting out the line:
https://github.com/Jammy2211/autofit_workspace_test/blob/main/database/directory/grid_search.py
This puts me in a position where I am attempting to scrape a grid search result which is unfinished.
If
completed_only=False
and we attempt to build a half finished grid search, what is the desired behaviour?Ideally, we would have all results accessible to us, using the aggregator. I think this might actually be the case already, albeit I cant check due to the issue in the other issue on this yet.
I think the more difficult thing we need to think about is the
GridSearchResult
, which is apickle
file output separately. From what I can tell, this is output and updated at the end of every grid search. So, if 2/4 GridSearch's have finished, it will have results like thelog_likelihood
for 2 of the searches.Ideally, If a GridSearch is unfinished we would still have access to all of the
GridSearchResult
's attributes. For example, in theGridSearchResult
, the propertylog_likelihoods_native
would still be available, however there would simply beNone
's in place when a result is unfinished.The reason for this is we have long suepr computer runs using grid searches where on-the-fly analysis is hugely benefitial.