generate_ideas.py
code:first_idea_input.py
[
{
"Name": "learning_rate_schedule",
"Title": "Adaptive Learning Rate Schedules: Comparing different learning rate schedules for diffusion models.",
"Experiment": "In this experiment, we compare the performance of different learning rate schedules on diffusion model performance. We use the final estimated KL as the evaluation metric.",
"Interestingness": 4,
"Feasibility": 10,
"Novelty": 3
}
]
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
idea_str_archive = []
with open(osp.join(base_dir, "seed_ideas.json"), "r") as f:
seed_ideas = json.load(f)
for seed_idea in seed_ideas:
idea_str_archive.append(json.dumps(seed_idea))
with open(osp.join(base_dir, "experiment.py"), "r") as f:
code = f.read()
with open(osp.join(base_dir, "prompt.json"), "r") as f:
prompt = json.load(f)
for _ in range(max_num_generations):
print()
print(f"Generating idea {_ + 1}/{max_num_generations}")
try:
prev_ideas_string = "\n\n".join(idea_str_archive)
msg_history = []
print(f"Iteration 1/{num_reflections}")
text, msg_history = get_response_from_llm(
idea_first_prompt.format(
code=code,
prev_ideas_string=prev_ideas_string,
num_reflections=num_reflections,
),
client=client,
model=model,
system_message=idea_system_prompt,
msg_history=msg_history,
)
code:how to input LLM?.py
text, msg_history = get_response_from_llm(
idea_first_prompt.format(
code=code,
⭐️prev_ideas_string=prev_ideas_string, ---> json format
num_reflections=num_reflections,
),
client=client,
model=model,
system_message=idea_system_prompt,
msg_history=msg_history,
)