From 1d3918403654b07732b67771309eba68abeeb2f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matt=C3=A9o=20Delabre?= Date: Mon, 16 Dec 2019 09:55:06 -0500 Subject: [PATCH] Use euclidean distance for stop criterion --- train.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/train.py b/train.py index 9e97551..d2a4b38 100644 --- a/train.py +++ b/train.py @@ -43,10 +43,6 @@ batch = 0 # Accumulated loss for last batches running_loss = 0 -# True in the first training phase where small batches are used, and false in -# the second phase where point positions are refined using large batches -is_coarse_optim = True - # List of training examples (not shuffled) classes_ordered = torch.arange(order).repeat(batch_size) @@ -84,7 +80,7 @@ while total_change >= 1e-4: # Check for convergence model.eval() constellation = model.get_constellation() - total_change = (constellation - prev_constellation).abs().sum() + total_change = (constellation - prev_constellation).norm(dim=1).sum() prev_constellation = constellation # Report loss