Modified early stoping to stop only after 0.50

This commit is contained in:
Eddie Cueto 2023-06-07 08:50:19 +01:00
parent 899e313cd9
commit 44272d52a7
4 changed files with 31 additions and 53 deletions

3
.gitignore vendored
View File

@ -10,9 +10,10 @@ experiment-power-draw/
stp stp
sav sav
bayes_* bayes_*
times_*
freq_* freq_*
*.pkl *.pkl
bay bay
frq frq
sav sav
tmp tmp

View File

@ -1,22 +1,37 @@
def earlyStopping(early_stopping: list, train_acc: float, sensitivity: float=1e-9): import amd_sample_draw
from time import sleep
def earlyStopping(early_stopping: list, train_acc: float, epoch: int, sensitivity: float=1e-9):
early_stopping.append(train_acc) early_stopping.append(train_acc)
if epoch % 4 == 0 and epoch > 0: if epoch % 4 == 0 and epoch > 0:
print("Value 1: {} >= {}, Value 2: {} >= {}, \ print("Value 1: {} > Value 2: {} > \
Value 2: {} >= {}".format(early_stopping[0], \ Value 3: {}".format(early_stopping[0], \
train_acc-sensitivity,early_stopping[1], \ abs(early_stopping[1]-sensitivity), \
train_acc-sensitivity, early_stopping[2], train_acc-sensitivity)) abs(early_stopping[2]-sensitivity)))
if abs(early_stopping[0]) >= train_acc-sensitivity and \ if train_acc > 0.5:
abs(early_stopping[1]) >= train_acc-sensitivity and \ if early_stopping[0] > abs(early_stopping[1]-sensitivity) and \
abs(early_stopping[2]) >= train_acc-sensitivity: early_stopping[1] > abs(early_stopping[2]-sensitivity):
return None print("Stopping Early")
early_stopping = [] return 1
del early_stopping[:]
return 0
def energyBound(threshold: float=100000.0): def energyBound(threshold: float=100000.0):
if gpu_sample_draw.total_watt_consumed() > threshold: try:
return None energy = amd_sample_draw.total_watt_consumed()
except Exception as e:
sleep(3)
energy = amd_sample_draw.total_watt_consumed()
print("Energy used: {}".format(energy))
if energy > threshold:
print("Energy bound achieved")
return 1
return 0
def accuracyBound(train_acc: float, threshold: float=0.99): def accuracyBound(train_acc: float, threshold: float=0.99):
if train_acc >= threshold: if train_acc >= threshold:
return None print("Accuracy bound achieved")
return 1
return 0

View File

@ -1,19 +0,0 @@
ini_1 = 12:03:15
fin_1 = 12:13:26
10m+11s
ini_2 = 12:29:28
fin_2 = 12:44:24
15m+56s
ini_3 = 13:00:55
fin_3 = 13:21:06
21m+11s
ini_4 = 13:24:28
fin_4 = 13:49:42
25m+14s
ini_5 = 14:14:27
fin_5 = 14:44:57
30m+30s

View File

@ -1,19 +0,0 @@
ini_1 = 11:08:51
fin_1 = 11:12:04
4m+13s
ini_2 = 11:31:03
fin_2 = 11:34:17
3m+14s
ini_3 = 11:25:17
fin_3 = 11:28:31
3m+14s
ini_4 = 11:37:09
fin_4 = 11:40:24
3m+15s
ini_5 = 11:43:29
fin_5 = 11:46:48
3m+19s