DeepFaceLab
DeepFaceLab copied to clipboard
Suggestion for averaging/smoothing loss curve
Trainer.py:
`def running_mean(x, N): cumsum = np.cumsum(np.insert(x, 0, 0)) return (cumsum[N:] - cumsum[:-N]) / float(N)
def main(args, device_args): ... if show_last_history_iters_count <= 10000: moving_aves = np.array(loss_history_to_show) N=400 lh1 = running_mean(moving_aves[:,0], N) lh2 = running_mean(moving_aves[:,1], N) res_lh = np.column_stack((lh1, lh2)) lh_img = models.ModelBase.get_loss_history_preview(res_lh, iter, w, c)
else:
lh_img = models.ModelBase.get_loss_history_preview(loss_history_to_show, iter, w, c)`
Result:

no thx. I need to view total max and min value