Correct initialization of convergence loop
This commit is contained in:
@@ -613,11 +613,10 @@ class background():
|
||||
|
||||
# Loss function
|
||||
loss = []#np.zeros(n_epochs, dtype=self.dtype)
|
||||
old_loss = 2000000
|
||||
new_loss = 1000000
|
||||
old_loss = 0
|
||||
new_loss = 0
|
||||
k = 0
|
||||
|
||||
while (old_loss - new_loss > 1e-3) and (k < n_epochs):
|
||||
while ((old_loss - new_loss > 1e-3) and (k < n_epochs)) or k < 2:
|
||||
# Compute A = Y - B by filling the nans with 0s
|
||||
A = np.where(np.isnan(Y_r - b_tmp) == True, 0.0, Y_r - b_tmp)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user