conda create -n ai_scientist1 python=3.11
conda activate ai_scientist1
# LLM APIs
pip install anthropic aider-chat backoff openai
# Viz
pip install matplotlib pypdf pymupdf4llm
# Install pdflatex
sudo apt-get install texlive-full
# Common Requirements
pip install torch numpy transformers datasets tiktoken wandb tqdm
export OPENAI_API_KEY="sk-proj-"
git clone https://github.com/SakanaAI/AI-Scientist.git
# 准备NanoGPT数据
python data/enwik8/prepare.py
python data/shakespeare_char/prepare.py
python data/text8/prepare.py
# 创建NanoGPT基线运行 训练NanoGPT模型建立一个基准
cd templates/nanoGPT
python experiment.py --out_dir run_0
python plot.py
cd ../..
export ANTHROPIC_API_KEY="sk-proj-"
python launch_scientist.py --model "claude-3-5-sonnet-20240620" --experiment nanoGPT --num-ideas 5
# --num-ideas 5表示生成5个研究想法
export OPENAI_API_KEY="sk-proj-"
python launch_scientist.py --model "gpt-4o-2024-05-13" --experiment nanoGPT --num-ideas 5
#export OPENAI_API_KEY="sk-proj-"
import openai
from ai_scientist.perform_review import load_paper, get_llm_review
client = openai.OpenAI()
model = "gpt-4o-2024-05-13"
paper_txt = load_paper("path_to_your_generated_paper.pdf")
review = get_llm_review(
paper_txt,
model,
client,
num_reflections=5,
num_fs_examples=1,
num_reviews_ensemble=5,
temperature=0.1,
)
print(review["Overall"]) # 总体评分
print(review["Decision"]) # 接受或拒绝
print(review["Weaknesses"]) # 弱点列表
cd review_iclr_bench
python iclr_analysis.py --num_reviews 500 --batch_size 100 --num_fs_examples 1 --num_reflections 5 --temperature 0.1 --num_reviews_ensemble 5
cd templates/2d_diffusion && python experiment.py --out_dir run_0 && python plot.py
cd templates/grokking && python experiment.py --out_dir run_0 && python plot.py
Comments