Pick the best result of a grid search. results is a list of dicts with a val_loss and a params entry; return the record with the lowest validation loss. Ties are broken by the smaller str(params), and an empty list returns None.
Implement solve(results).
Returns. Return the winning record (the same dict object), or None for an empty input.
Example 1
Input:
solve([{'val_loss': 0.8, 'params': {'lr': 0.1}}, {'val_loss': 0.5, 'params': {'lr': 0.01}}])
Output:
{'val_loss': 0.5, 'params': {'lr': 0.01}}
Example 2
Input:
solve([{'val_loss': 0.5, 'params': {'lr': 0.1}}, {'val_loss': 0.5, 'params': {'lr': 0.01}}])
Output:
{'val_loss': 0.5, 'params': {'lr': 0.01}}
No results yet
Run your code to check it against the examples, or submit to run every test.