mirror of
https://github.com/iperov/DeepFaceLive
synced 2025-08-19 21:13:21 -07:00
_
This commit is contained in:
parent
894ec56a93
commit
97991ca5cf
2 changed files with 8 additions and 13 deletions
|
@ -369,9 +369,11 @@ class FaceAlignerTrainerApp:
|
||||||
d = len(lh) // max_lines
|
d = len(lh) // max_lines
|
||||||
|
|
||||||
lh_ar = np.array(lh[-d*max_lines:], np.float32)
|
lh_ar = np.array(lh[-d*max_lines:], np.float32)
|
||||||
lh_ar = lh_ar.reshape( (max_lines, d)).mean(-1)
|
lh_ar = lh_ar.reshape( (max_lines, d))
|
||||||
|
lh_ar_max, lh_ar_min, lh_ar_mean, lh_ar_median = lh_ar.max(-1), lh_ar.min(-1), lh_ar.mean(-1), np.median(lh_ar, -1)
|
||||||
|
|
||||||
print( '\n'.join( f'{value:.5f}' for value in lh_ar ) )
|
|
||||||
|
print( '\n'.join( f'max:[{max_value:.5f}] min:[{min_value:.5f}] mean:[{mean_value:.5f}] median:[{median_value:.5f}]' for max_value, min_value, mean_value, median_value in zip(lh_ar_max, lh_ar_min, lh_ar_mean, lh_ar_median) ) )
|
||||||
|
|
||||||
dlg.recreate().set_current()
|
dlg.recreate().set_current()
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import torch
|
import torch
|
||||||
import numpy as np
|
|
||||||
|
|
||||||
class AdaBelief(torch.optim.Optimizer):
|
class AdaBelief(torch.optim.Optimizer):
|
||||||
def __init__(self, params, lr=1e-3, betas=(0.9, 0.999), eps=1e-16,
|
def __init__(self, params, lr=1e-3, betas=(0.9, 0.999), eps=1e-16,
|
||||||
|
@ -50,10 +49,4 @@ class AdaBelief(torch.optim.Optimizer):
|
||||||
lrd_rand = torch.ones_like(p.data)
|
lrd_rand = torch.ones_like(p.data)
|
||||||
v_diff *= torch.bernoulli(lrd_rand * group['lr_dropout'] )
|
v_diff *= torch.bernoulli(lrd_rand * group['lr_dropout'] )
|
||||||
|
|
||||||
# from xlib.console.diacon import Diacon
|
|
||||||
# Diacon.stop()
|
|
||||||
# import code
|
|
||||||
# code.interact(local=dict(globals(), **locals()))
|
|
||||||
|
|
||||||
|
|
||||||
p.data.add_(v_diff)
|
p.data.add_(v_diff)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue