Modified early stoping to stop only after 0.50
This commit is contained in:
parent
899e313cd9
commit
44272d52a7
|
@ -10,6 +10,7 @@ experiment-power-draw/
|
|||
stp
|
||||
sav
|
||||
bayes_*
|
||||
times_*
|
||||
freq_*
|
||||
*.pkl
|
||||
bay
|
||||
|
|
|
@ -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)
|
||||
if epoch % 4 == 0 and epoch > 0:
|
||||
print("Value 1: {} >= {}, Value 2: {} >= {}, \
|
||||
Value 2: {} >= {}".format(early_stopping[0], \
|
||||
train_acc-sensitivity,early_stopping[1], \
|
||||
train_acc-sensitivity, early_stopping[2], train_acc-sensitivity))
|
||||
if abs(early_stopping[0]) >= train_acc-sensitivity and \
|
||||
abs(early_stopping[1]) >= train_acc-sensitivity and \
|
||||
abs(early_stopping[2]) >= train_acc-sensitivity:
|
||||
return None
|
||||
early_stopping = []
|
||||
print("Value 1: {} > Value 2: {} > \
|
||||
Value 3: {}".format(early_stopping[0], \
|
||||
abs(early_stopping[1]-sensitivity), \
|
||||
abs(early_stopping[2]-sensitivity)))
|
||||
if train_acc > 0.5:
|
||||
if early_stopping[0] > abs(early_stopping[1]-sensitivity) and \
|
||||
early_stopping[1] > abs(early_stopping[2]-sensitivity):
|
||||
print("Stopping Early")
|
||||
return 1
|
||||
del early_stopping[:]
|
||||
return 0
|
||||
|
||||
|
||||
def energyBound(threshold: float=100000.0):
|
||||
if gpu_sample_draw.total_watt_consumed() > threshold:
|
||||
return None
|
||||
|
||||
try:
|
||||
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):
|
||||
if train_acc >= threshold:
|
||||
return None
|
||||
print("Accuracy bound achieved")
|
||||
return 1
|
||||
return 0
|
||||
|
|
|
@ -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
|
|
@ -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
|
Loading…
Reference in New Issue