"docs/SQuAD_evolution_examples.md" did not exist on "c556d1202ea2c33bd441063faa431c39664f8648"
Commit e051fae0 authored by ShufanHuang's avatar ShufanHuang Committed by chicm-ms
Browse files

Fix bug in Curvefitting Assessor (#798)

Fix bug in Curvefitting Assessor
parent 8353c1d3
...@@ -57,8 +57,8 @@ class CurvefittingAssessor(Assessor): ...@@ -57,8 +57,8 @@ class CurvefittingAssessor(Assessor):
self.threshold = threshold self.threshold = threshold
# Record the number of gap # Record the number of gap
self.gap = gap self.gap = gap
# Record the number of times of judgments # Record the number of intermediate result in the lastest judgment
self.judgment_num = 0 self.last_judgment_num = dict()
# Record the best performance # Record the best performance
self.set_best_performance = False self.set_best_performance = False
self.completed_best_performance = None self.completed_best_performance = None
...@@ -112,9 +112,10 @@ class CurvefittingAssessor(Assessor): ...@@ -112,9 +112,10 @@ class CurvefittingAssessor(Assessor):
curr_step = len(trial_history) curr_step = len(trial_history)
if curr_step < self.start_step: if curr_step < self.start_step:
return AssessResult.Good return AssessResult.Good
if (curr_step - self.start_step) // self.gap <= self.judgment_num:
if trial_job_id in self.last_judgment_num.keys() and curr_step - self.last_judgment_num[trial_job_id] < self.gap:
return AssessResult.Good return AssessResult.Good
self.judgment_num = (curr_step - self.start_step) // self.gap self.last_judgment_num[trial_job_id] = curr_step
try: try:
start_time = datetime.datetime.now() start_time = datetime.datetime.now()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment