Sane words early s2

This commit is contained in:
ksanu 2019-11-29 15:25:36 +01:00
parent 7deda60d20
commit f6f923d988
5 changed files with 28416 additions and 28415 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -85,8 +85,8 @@ for i in range(80):
#print(str(i), " ; ", cost) #print(str(i), " ; ", cost)
if (cost.item() < 40000): if (cost.item() < 40000):
learning_rate = torch.tensor(0.00001, dtype=torch.float) learning_rate = torch.tensor(0.00001, dtype=torch.float)
#if (cost.item() < 1614): if (cost.item() < 1700):
# learning_rate = torch.tensor(0.000001, dtype=torch.float) learning_rate = torch.tensor(0.000001, dtype=torch.float)
with torch.no_grad(): with torch.no_grad():
W1 = W1 - learning_rate * W1.grad W1 = W1 - learning_rate * W1.grad
b1 = b1 - learning_rate * b1.grad b1 = b1 - learning_rate * b1.grad
@ -96,8 +96,9 @@ for i in range(80):
dev_y_test = model(dev_x) dev_y_test = model(dev_x)
dev_y_test_f = dev_y_test.numpy() dev_y_test_f = dev_y_test.numpy()
dev_y_test = np.where(dev_y_test_f > 0.5, 1, 0) dev_y_test = np.where(dev_y_test_f > 0.5, 1, 0)
print(dev_y_test) #print(dev_y_test)
score = f1_score(dev_y_test, dev_y_pred) recall = recall_score(dev_y_test, dev_y_pred, average='micro')
F1 = f1_score(dev_y_test, dev_y_pred)
W1.requires_grad_(True) W1.requires_grad_(True)
@ -105,15 +106,15 @@ for i in range(80):
W2.requires_grad_(True) W2.requires_grad_(True)
b2.requires_grad_(True) b2.requires_grad_(True)
if (score < 0.35): if ((F1 > 0.3) & (F1<0.7)):
break break
print(dev_y_test)
print(F1, recall )
print(score)
print(str(i), " ; ", cost)
print(str(i), " ; ", cost) print(str(i), " ; ", cost)
if ((F1 > 0.3) & (F1<0.7)):
break

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff