All problems

Is Training Actually Converging?

easyPythonGradient Descent

Every training run at Kestrel Freight writes one cost to the log per epoch — an epoch being one full pass over the deliveries — and somebody has to skim hundreds of those logs. A healthy run improves on every single pass. A run whose cost bounces, or stalls at the same figure for a pass, has something wrong with it and is worth a human's attention, whatever it does later. The team wants that judgement automated, and they want it strict: no allowance for a bad epoch that the run recovers from, and no allowance for a pass that changed nothing.

Task: Print whether the logged run improved on every epoch.

Input

The first line holds one integer n, the number of epochs logged, where 2 <= n <= 1000. The second line holds n numbers separated by single spaces: the cost after each epoch, in epoch order.

Output

One line, exactly converging if every cost is strictly lower than the one before it, and exactly diverging otherwise. A cost equal to the one before it is not an improvement.

Example:

Input:
5
10 7 5 3 2

Output:
converging

Sign in to solve this problem

Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.

Sign in

Discussion

Sign in to join the discussion — reading is open to everyone.

Loading comments…