CUNY-CL / yoyodyne

Small-vocabulary sequence-to-sequence generation with optional feature conditioning
Apache License 2.0
25 stars 15 forks source link

Metrics helpers #175

Closed kylebgorman closed 2 months ago

kylebgorman commented 2 months ago

This adds a small metrics struct which stores the information that loss should be minimized, accuracy should be maximized, and generates appropriate file names for checkpoints. It is then used in train.py to implement the checkpointing callback and the patience callback, and in schedulers.py to implement the reduce-on-plateau scheduler.

Whereas #171 used the same flag (--val_metric) to do checkpointing and patience, offline discussion concluded that we want these to be separate. Naturally the reduce-on-plateau scheduler was also left separate.

Some flags have been renamed, and I am happy to discuss this further:

Since there has been a decent amount of plumbing changes here, I'd appreciate a closer review. However, my local tests seem just fine.

This PR is a followup to PR #171 and a further response to issue #170.

kylebgorman commented 2 months ago

Just pushed fixes to everything: you want to take a second look before I merge? (Give me the Approve radio button under the review thingy so I can merge without override...)