-
-
Notifications
You must be signed in to change notification settings - Fork 156
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
feat: Enabling automation of experiments running v2.0 #469
base: main
Are you sure you want to change the base?
Changes from 1 commit
8726ab8
b44bef5
c100876
18370d4
21a99d2
86ae0b2
f94dbff
66ffd6d
0ef80a5
907d980
51388d1
af6220e
54c3c6d
78708e4
3f131f3
38bb9e6
10b0053
238f492
68ca63a
8b18fad
2395dc5
b7cc98e
0b5a09d
24cd0c2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
if_using_vector_rag=False | ||
if_using_graph_rag=False | ||
if_action_choosing_based_on_UCB=False | ||
model_feature_selection_coder=True | ||
hypothesis_gen=True | ||
KG_IF_USING_VECTOR_RAG=False | ||
KG_IF_USING_GRAPH_RAG=False | ||
KG_IF_ACTION_CHOOSING_BASED_ON_UCB=False | ||
KG_MODEL_FEATURE_SELECTION_CODER=True | ||
KG_HYPOTHESIS_GEN=True |
This file was deleted.
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.
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
if_using_vector_rag=True | ||
if_using_graph_rag=True | ||
if_action_choosing_based_on_UCB=True | ||
model_feature_selection_coder=True | ||
hypothesis_gen=True | ||
KG_IF_USING_VECTOR_RAG=True | ||
KG_IF_USING_GRAPH_RAG=True | ||
KG_IF_ACTION_CHOOSING_BASED_ON_UCB=True | ||
KG_MODEL_FEATURE_SELECTION_CODER=True | ||
KG_HYPOTHESIS_GEN=True |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
if_using_vector_rag=True | ||
if_using_graph_rag=False | ||
if_action_choosing_based_on_UCB=True | ||
model_feature_selection_coder=True | ||
hypothesis_gen=False | ||
KG_IF_USING_VECTOR_RAG=True | ||
KG_IF_USING_GRAPH_RAG=False | ||
KG_IF_ACTION_CHOOSING_BASED_ON_UCB=True | ||
KG_MODEL_FEATURE_SELECTION_CODER=True | ||
KG_HYPOTHESIS_GEN=False |
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. Here, it also needs to add the path to the knowledge base. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
if_using_vector_rag=True | ||
if_using_graph_rag=False | ||
if_action_choosing_based_on_UCB=True | ||
model_feature_selection_coder=True | ||
hypothesis_gen=True | ||
KG_IF_USING_VECTOR_RAG=True | ||
KG_IF_USING_GRAPH_RAG=False | ||
KG_IF_ACTION_CHOOSING_BASED_ON_UCB=True | ||
KG_MODEL_FEATURE_SELECTION_CODER=True | ||
KG_HYPOTHESIS_GEN=True |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import os | ||
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. Will the env name (e.g. basic, max, pro) displayed in the collected results? |
||
import json | ||
import argparse | ||
from pathlib import Path | ||
from datetime import datetime | ||
from rdagent.log.storage import FileStorage | ||
|
@@ -56,12 +57,27 @@ def generate_summary(results, output_path): | |
"competition_name": result["competition_name"] | ||
}) | ||
|
||
with open(output_path, "w") as f: | ||
with open(output_path, "w") as f: | ||
json.dump(summary, f, indent=4) | ||
|
||
def parse_args(): | ||
parser = argparse.ArgumentParser(description='Collect and summarize experiment results') | ||
parser.add_argument('--log_path', type=str, required=True, | ||
help='Path to the log directory containing experiment results') | ||
parser.add_argument('--output_name', type=str, default='summary.json', | ||
help='Name of the output summary file (default: summary.json)') | ||
return parser.parse_args() | ||
|
||
if __name__ == "__main__": | ||
sample_result_dir = Path("/home/bowen/workspace/RD-Agent/log/MAY2022_5") | ||
results = collect_results(sample_result_dir ) | ||
generate_summary(results, os.path.join(sample_result_dir, "summary.json")) | ||
print("Summary generated successfully at ", os.path.join(sample_result_dir, "summary.json")) | ||
args = parse_args() | ||
log_path = Path(args.log_path) | ||
|
||
# Verify the log path exists | ||
if not log_path.exists(): | ||
raise FileNotFoundError(f"Log path does not exist: {log_path}") | ||
|
||
results = collect_results(log_path) | ||
output_path = log_path / args.output_name | ||
generate_summary(results, output_path) | ||
print("Summary generated successfully at", output_path) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,23 +5,15 @@ TEST_DIR="test_run" | |
mkdir -p "$TEST_DIR/results" | ||
mkdir -p "$TEST_DIR/logs" | ||
|
||
# Test 1: Environment loading verification | ||
echo "Testing environment loading..." | ||
./scripts/exp/tools/run_envs.sh -d scripts/exp/ablation/env -j 1 -- env | grep "if_using" | ||
# Define paths | ||
ENV_DIR="/home/v-xisenwang/RD-Agent/scripts/exp/ablation/env" | ||
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. I think it would be better to use config for the path instead of hard-coded |
||
PYTHON_SCRIPT="/home/v-xisenwang/RD-Agent/rdagent/app/kaggle/loop.py" | ||
|
||
# Test 2: Run actual experiments | ||
echo "Running experiments with different configurations..." | ||
./scripts/exp/tools/run_envs.sh -d scripts/exp/ablation/env -j 4 -- \ | ||
python -m rdagent.app.kaggle.loop \ | ||
--competition "titanic" \ | ||
--result_path "${TEST_DIR}/results/$(basename {} .env)_result.json" | ||
# Run the experiment | ||
echo "Running experiments..." | ||
dotenv run -- ./scripts/exp/tools/run_envs.sh -d "$ENV_DIR" -j 4 -- \ | ||
python "$PYTHON_SCRIPT" \ | ||
--competition "spaceship-titanic" \ | ||
|
||
# Test 3: Result collection | ||
echo "Collecting and analyzing results..." | ||
EXP_DIR="$TEST_DIR" python scripts/exp/tools/collect.py | ||
|
||
# Display results location | ||
echo "Test results available at: $TEST_DIR" | ||
|
||
# Cleanup | ||
rm -rf "$TEST_DIR" | ||
# Cleanup (optional - comment out if you want to keep results) | ||
# rm -rf "$TEST_DIR" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, it needs to add the path to the knowledge base.