Skip to content

Commit 65b7a49

Browse files
author
Philipp Holl
committed
Fix train() with max_epochs
1 parent cff36f9 commit 65b7a49

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

phiml/nn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ def train(name: Optional[str], model, optimizer, loss_fn: Callable,
436436
learning_rate = None if lr_schedule_iter is not None else get_learning_rate(optimizer)
437437
if max_epochs is None and max_iter is not None:
438438
max_epochs = int(np.ceil(max_iter / batch_count))
439-
elif max_epochs is not None and max_iter is not None:
439+
elif max_epochs is not None and max_iter is None:
440440
max_iter = max_epochs * batch_count
441441
termination_reason = None
442442
niter = 0

0 commit comments

Comments
 (0)