From bcf842f9128fe98f74a9956783b827fec04c26d9 Mon Sep 17 00:00:00 2001 From: WinstonLiyt <104308117+WinstonLiyt@users.noreply.github.com> Date: Tue, 24 Sep 2024 18:42:14 +0800 Subject: [PATCH] change the mechanism of traceback and action choosing (#320) --- rdagent/scenarios/kaggle/proposal/proposal.py | 6 +++--- rdagent/utils/workflow.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rdagent/scenarios/kaggle/proposal/proposal.py b/rdagent/scenarios/kaggle/proposal/proposal.py index 9efd3c0f..a8e1f06e 100644 --- a/rdagent/scenarios/kaggle/proposal/proposal.py +++ b/rdagent/scenarios/kaggle/proposal/proposal.py @@ -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 diff --git a/rdagent/utils/workflow.py b/rdagent/utils/workflow.py index b49b6af6..0c1f369b 100644 --- a/rdagent/utils/workflow.py +++ b/rdagent/utils/workflow.py @@ -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)