round rather than ceil

This commit is contained in:
Damian Stewart 2023-03-09 20:47:37 +01:00
parent 103ab20696
commit 47e90ad865
1 changed files with 1 additions and 1 deletions

View File

@ -102,7 +102,7 @@ class EveryDreamValidator:
# last step only
return [epoch_length_steps-1]
# subdivide the epoch evenly, by rounding self.every_n_epochs to the nearest clean division of steps
num_divisions = min(epoch_length_steps, math.ceil(1/self.every_n_epochs))
num_divisions = max(1, min(epoch_length_steps, round(1/self.every_n_epochs)))
# validation happens after training:
# if an epoch has eg 100 steps and num_divisions is 2, then validation should occur after steps 49 and 99
validate_every_n_steps = epoch_length_steps / num_divisions