Decide whether training should stop early. Scan the validation losses in order; an epoch is bad if its loss is not strictly lower than the best loss seen so far, and the bad-epoch counter resets whenever a new best is reached. Return True as soon as the counter reaches patience.
Implement solve(losses,patience).
Returns. Return True if training would have stopped somewhere in the list, otherwise False.
Example 1
Input:
solve([1.0, 0.9, 0.95, 0.96], 1)
Output:
True
Example 2
Input:
solve([1.0, 0.9, 0.95, 0.96], 3)
Output:
False
Example 3
Input:
solve([1.0, 0.9, 0.8, 0.7], 2)
Output:
False
No results yet
Run your code to check it against the examples, or submit to run every test.