Bug fix in training
This commit is contained in:
parent
b771204b1b
commit
8c4e35bf41
@ -835,7 +835,7 @@ def train(gamma = 1, full=True):
|
|||||||
best_mse = mse
|
best_mse = mse
|
||||||
stagLen = 0
|
stagLen = 0
|
||||||
|
|
||||||
while gamma > 1.0e-06 and delta > 1.0e-06 or best_mse > 3:
|
while gamma > 1.0e-06 and delta > 1.0e-05 or best_mse > 3:
|
||||||
last_mse = mse
|
last_mse = mse
|
||||||
print({'mse': mse, 'gamma': gamma, 'delta': delta})
|
print({'mse': mse, 'gamma': gamma, 'delta': delta})
|
||||||
delta = sum(gradient[g]**2 for g in gradient)
|
delta = sum(gradient[g]**2 for g in gradient)
|
||||||
@ -852,6 +852,7 @@ def train(gamma = 1, full=True):
|
|||||||
else:
|
else:
|
||||||
stagLen += 1
|
stagLen += 1
|
||||||
if stagLen == 3 or mse > 100:
|
if stagLen == 3 or mse > 100:
|
||||||
|
stagLen = -2
|
||||||
for wt in weights:
|
for wt in weights:
|
||||||
weights[wt] = random.random()
|
weights[wt] = random.random()
|
||||||
print('Done.')
|
print('Done.')
|
||||||
|
Loading…
Reference in New Issue
Block a user