Skip to content

Commit 3fbc196

Browse files
committed
optimizer state values should be taken as mean absolute otherwise you could underestimate changes
1 parent 2659ce1 commit 3fbc196

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sup3r/models/abstract.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1071,7 +1071,8 @@ def get_optimizer_state(cls, optimizer):
10711071
state = {'learning_rate': lr}
10721072
for var in optimizer.variables:
10731073
name = var.name
1074-
var = var.numpy().flatten().mean() # collapse ndarrays
1074+
var = var.numpy().flatten()
1075+
var = np.abs(var).mean() # collapse ndarrays into mean absolute
10751076
state[name] = float(var)
10761077
return state
10771078

0 commit comments

Comments
 (0)