Before changing all codes for per-epoch and per-training