Merge branch 'master' of github.com:BayesWatch/nas-without-training

This commit is contained in:
jack-willturner
2020-06-03 15:42:24 +01:00
4 changed files with 29 additions and 6 deletions

View File

@@ -55,7 +55,7 @@ def get_batch_jacobian(net, x, target, to, device, args=None):
return jacob, target.detach()
def evidenceapprox_eval_score(jacob, labels=None):
def eval_score(jacob, labels=None):
corrs = np.corrcoef(jacob)
v, _ = np.linalg.eig(corrs)
k = 1e-5
@@ -122,7 +122,7 @@ for N in runs:
jacobs = jacobs.reshape(jacobs.size(0), -1).cpu().numpy()
try:
s = evidenceapprox_eval_score(jacobs, labels)
s = eval_score(jacobs, labels)
except Exception as e:
print(e)
s = np.nan