change the mechanism of traceback and action choosing (#320)

This commit is contained in:
WinstonLiyt
2024-09-24 18:42:14 +08:00
committed by GitHub
parent 1ee2f5d764
commit 51b6038c2e
2 changed files with 4 additions and 4 deletions
@@ -91,8 +91,8 @@ class KGHypothesisGen(ModelHypothesisGen):
self.reward_estimates = {
"Feature engineering": 0.0,
"Feature processing": 0.0,
"Model feature selection": 0.0,
"Model tuning": 0.5,
"Model feature selection": 0.2,
"Model tuning": 1.0,
}
self.confidence_parameter = 1.0
self.initial_performance = 0.0
@@ -192,7 +192,7 @@ class KGHypothesisGen(ModelHypothesisGen):
else:
performance_t_minus_1 = self.initial_performance
reward = performance_t_minus_1 - performance_t
reward = (performance_t - performance_t_minus_1) / performance_t_minus_1
n_o = self.action_counts[last_action]
mu_o = self.reward_estimates[last_action]
self.reward_estimates[last_action] += (reward - mu_o) / n_o
+1 -1
View File
@@ -117,7 +117,7 @@ class LoopBase:
continue
except CoderError as e:
logger.warning(f"Traceback loop {li} due to {e}")
self.step_idx -= 1
self.step_idx = 0
continue
end = datetime.datetime.now(datetime.timezone.utc)