-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix: add spec for hyperparameters in task design and coder #995
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 25 commits
da36f43
979640a
2c87022
ccdb471
84bf563
13be390
4ca0411
c122816
ffec796
ffe70ca
b1f03f2
771e7e8
55d8d03
3619c95
3f487fe
6ec2080
7d27e09
b669365
bbb8bcf
49d9686
43255d6
1995f6a
8944273
81d284a
a18e454
408e7ab
beb3bf8
93a3acd
3a15f5c
6d9607a
8312380
ed984eb
ceb6335
833be8f
2e6d190
71e68c6
2b8a2ed
e56ebfd
7caad02
eb9ec5d
2ebcc35
65deb7d
1edf3a9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Hoder-zyf marked this conversation as resolved.
Show resolved
Hide resolved
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,50 @@ | ||
| from rdagent.scenarios.data_science.proposal.exp_gen.base import DSTrace | ||
| from rdagent.app.data_science.conf import DS_RD_SETTING | ||
Hoder-zyf marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| from rdagent.core.proposal import ExpGen | ||
| from rdagent.core.scenario import Scenario | ||
| from rdagent.log import rdagent_logger as logger | ||
| from rdagent.oai.llm_utils import APIBackend, md5_hash | ||
| from rdagent.scenarios.data_science.experiment.experiment import DSExperiment | ||
| from rdagent.scenarios.data_science.proposal.exp_gen.base import DSHypothesis, DSTrace | ||
| from rdagent.scenarios.data_science.proposal.exp_gen.draft import DSDraftExpGen | ||
| from rdagent.scenarios.data_science.proposal.exp_gen.proposal import ( | ||
| DSProposalV1ExpGen, | ||
| DSProposalV2ExpGen, | ||
| ) | ||
| from rdagent.scenarios.data_science.proposal.exp_gen.refine import DSRefineExpGen | ||
| from rdagent.scenarios.data_science.scen import DataScienceScen | ||
| from rdagent.utils.agent.tpl import T | ||
|
|
||
| __all__ = ["DSTrace"] | ||
|
|
||
| class DSExpGen(ExpGen): | ||
| """ | ||
| Data Science Task Generator. | ||
| This is a experiment router generator; | ||
| """ | ||
|
|
||
| def __init__(self, *args, **kwargs): | ||
| super().__init__(*args, **kwargs) | ||
|
|
||
| def gen(self, trace: DSTrace) -> DSExperiment: | ||
| pipeline = DS_RD_SETTING.coder_on_whole_pipeline | ||
| sota_exp = trace.sota_experiment() | ||
|
|
||
| # Draft | ||
| # TODO: draft here | ||
| if sota_exp is None: | ||
| pass | ||
|
|
||
| # Refine | ||
| # TODO: introduce LLMs to decide whether to refine. Current: rule-based. | ||
| if sota_exp is not None: | ||
| # TODO: I think the logic of the sota_experiment_fb() should be refined | ||
| sota_exp_fb = trace.sota_experiment_fb()[-1] | ||
| sota_exp_idx = trace.sota_experiment_idx() | ||
| last_exp_idx = -1 | ||
| if pipeline and sota_exp_fb.refine_decision and (last_exp_idx - sota_exp_idx) <= 2: | ||
| return DSRefineExpGen(scen=self.scen).gen(trace=trace) | ||
|
|
||
| # Propose | ||
| if DS_RD_SETTING.proposal_version == "v1": | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hope to remove proposal_version in this version. |
||
| return DSProposalV1ExpGen(scen=self.scen).gen(trace=trace) | ||
| if DS_RD_SETTING.proposal_version == "v2": | ||
| return DSProposalV2ExpGen(scen=self.scen).gen(trace=trace) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| task_gen: | ||
| system: |- | ||
| {% include "scenarios.data_science.share:scen.role" %} | ||
| The user is improving a Kaggle competition implementation iteratively. Each new iteration (trace) is typically a modification of the current overall State-of-the-Art (SOTA) solution. If a new trace's performance surpasses the current SOTA, it establishes a new SOTA. Otherwise, it is considered a failed experiment. | ||
| You will be provided with: | ||
| 1. A detailed competition scenario description. | ||
| 2. A history of previous successfully experiments and their associated feedbacks, indexed or ordered from oldest to newest; the latest SOTA experiment accumulates all the improvements from the previous successful experiments. | ||
| 3. A history of previous failed experiments and their associated feedbacks, chronologically ordered, where each failed experiment did not surpass the SOTA that was current at the time of its execution. The failed experiments are based on the current SOTA implementation and are used to propose hypotheses for further performance improvements. | ||
| 4. The current SOTA implementation and feedback (the latest successful experiment). | ||
| 5. A proposed refinement hypothesis. Previous analysis demonstrated that the current SOTA implementation is not effective enough in terms of efficiency and hyperparameters. | ||
| Your goal is to generate a detailed, step-by-step **refinement plan** for current SOTA implementation that effectively implements the `Proposed Hypothesis`. | ||
| # Task Design Specification | ||
| {% include "scenarios.data_science.share:component_spec.Pipeline" %} | ||
| # Task Design Guidelines | ||
| {% include "scenarios.data_science.share:guidelines.refine" %} | ||
| # Refinement Specification | ||
| ## Hypothesis: {{ hypothesis.hypothesis }} | ||
|
||
| ### Reason: {{ hypothesis.reason }} | ||
| ## Hyperparameters Tuning: | ||
| {% include "scenarios.data_science.share:spec.hyperparameter" %} | ||
| # Output Format | ||
| Your final output should strictly adhere to the following JSON format without anything else: | ||
| {{ task_output_format }} | ||
| user: |- | ||
| # Competition Scenario Description | ||
| {{ scenario_desc }} | ||
| # Data Folder Structure (All files are under {% include "scenarios.data_science.share:scen.input_path" %}) | ||
| {{ data_folder_info }} | ||
| # Current SOTA Implementation & Feedback | ||
| {{ sota_exp_desc }} | ||
| # Previous Experiments & Feedback | ||
| {{ exp_and_feedback_list_desc }} | ||
Uh oh!
There was an error while loading. Please reload this page.