Loss seems to low?
This commit is contained in:
parent
cac86ef6ab
commit
9c6077e213
@ -492,7 +492,7 @@ class Runtime():
|
|||||||
return model, gen
|
return model, gen
|
||||||
|
|
||||||
def getModelFileName(self):
|
def getModelFileName(self):
|
||||||
return 'brains/utt.vac'
|
return 'brains/uttt.vac'
|
||||||
|
|
||||||
def saveToMemoryBank(self, term):
|
def saveToMemoryBank(self, term):
|
||||||
return
|
return
|
||||||
@ -605,7 +605,7 @@ class Trainer(Runtime):
|
|||||||
self.killWorker()
|
self.killWorker()
|
||||||
print('')
|
print('')
|
||||||
|
|
||||||
def trainModel(self, model, lr=0.00005, cut=0.01, calcDepth=4, exacity=5, terms=None, batch=16):
|
def trainModel(self, model, lr=0.000001, cut=0.01, calcDepth=4, exacity=5, terms=None, batch=16):
|
||||||
loss_func = nn.MSELoss()
|
loss_func = nn.MSELoss()
|
||||||
optimizer = optim.Adam(model.parameters(), lr)
|
optimizer = optim.Adam(model.parameters(), lr)
|
||||||
if terms == None:
|
if terms == None:
|
||||||
@ -631,9 +631,9 @@ class Trainer(Runtime):
|
|||||||
loss_sum += loss.item()
|
loss_sum += loss.item()
|
||||||
if loss.item() == 0.0:
|
if loss.item() == 0.0:
|
||||||
zeroLen += 1
|
zeroLen += 1
|
||||||
if zeroLen == 5:
|
if zeroLen == 5:
|
||||||
break
|
break
|
||||||
# print(loss_sum/i)
|
print(loss_sum/i)
|
||||||
if r > 16 and (loss_sum/i < cut or lLoss == loss_sum):
|
if r > 16 and (loss_sum/i < cut or lLoss == loss_sum):
|
||||||
return loss_sum
|
return loss_sum
|
||||||
lLoss = loss_sum
|
lLoss = loss_sum
|
||||||
|
Loading…
Reference in New Issue
Block a user