This gate is a rubber stamp. It reads training accuracy — and an overfit model always aces the data it memorized. The 0.99 sails through while the held-out score, the only number that predicts real-world behavior, says 0.71.
Fix the gate so it reads the held-out score. The overfit model should be held, not shipped.
Expected output:
gated on: 0.71
gate: hold
The break is on line 8 — but read the whole snippet first.