スキル一覧に戻る
smith6jt-cop

training-code-verification

by smith6jt-cop

Using skills repo for AI memory management.

0🍴 0📅 2026年1月23日
GitHubで見るManusで実行

SKILL.md


Training Code Verification Checklist

MANDATORY Before Any Training Code Change

DO NOT make assumptions. VERIFY everything.

1. File Paths - CHECK ACTUAL FILES

# List actual files in the repo
ls -la *.txt                    # API key files
ls -la notebooks/               # Notebook files
ls -la alpaca_trading/gpu/      # Training modules

Common mistakes:

  • Assuming API_key.txt exists (actual: API_key_500Paper.txt, API_key_100kPaper.txt)
  • Assuming Google Drive paths in Colab (actual: /content/Alpaca_trading/ after unzip)
  • Assuming relative paths work (use absolute paths)

2. Configuration Values - READ BEFORE CHANGING

# ALWAYS read current values first
from alpaca_trading.gpu.vectorized_env import GPUEnvConfig
config = GPUEnvConfig()

# Print ALL values before changing anything
print(f"direction_weight: {config.direction_weight}")
print(f"magnitude_weight: {config.magnitude_weight}")
print(f"pnl_weight: {config.pnl_weight}")
print(f"reward_scale: {config.reward_scale}")
# ... etc

Never assume a value. Read it.

3. Version Strings - VERIFY CONSISTENCY

Check ALL places where version is mentioned:

grep -r "v2\." notebooks/training.ipynb | head -20

All version strings must match. Don't leave old versions.

4. Notebook Cells - CHECK CELL NUMBERS

Notebook cells can shift. Don't assume "cell 15" is always the same cell.

# Find cell by content, not number
import json
nb = json.load(open('notebooks/training.ipynb'))
for i, cell in enumerate(nb['cells']):
    source = ''.join(cell.get('source', []))
    if 'API_KEYS_FILE' in source:
        print(f"Cell {i}: API_KEYS_FILE config")

5. Weight Sums - MUST EQUAL 1.0

weight_sum = (
    config.direction_weight +
    config.magnitude_weight +
    config.pnl_weight +
    config.stop_tp_weight +
    config.exploration_weight +
    config.slippage_weight +
    config.drawdown_penalty_weight
)
assert abs(weight_sum - 1.0) < 0.001, f"Weight sum is {weight_sum}, must be 1.0"

6. Tests - RUN BEFORE COMMITTING

# Run relevant tests
python -m pytest tests/test_ppo_trainer_native.py -v
python -m pytest tests/test_gpu_training.py -v
python -m pytest tests/test_data_fetcher.py -v

7. Colab Workflow - UNDERSTAND THE ENVIRONMENT

LocationWindows LocalColab After Unzip
Repo rootC:\users\smith\Alpaca_trading\/content/Alpaca_trading/
API keysAPI_key_500Paper.txt/content/Alpaca_trading/API_key_500Paper.txt
Notebooksnotebooks\training.ipynb/content/Alpaca_trading/notebooks/training.ipynb
DriveN/A/content/drive/MyDrive/ (separate from repo)

Failed Attempts Log

DateMistakeImpactLesson
2024-12-28Assumed API_key.txt existsyfinance fallback usedCheck actual filenames
2024-12-28Suggested /content/drive/MyDrive/ pathFile not foundUnzip goes to /content/, not Drive
2024-12-28Silent exception in key loadingNo error shownAdd logging, don't swallow exceptions

Before Committing Checklist

  • Read current values before changing
  • Verify file paths exist
  • Check all version strings match
  • Verify weight sums equal 1.0
  • Run relevant tests
  • Test in actual environment (Colab if that's target)
  • Check logs show expected behavior

Key Principle

Don't assume. Verify.

Every assumption is a potential bug. Read the actual state. Check the actual files. Run the actual tests.

スコア

総合スコア

40/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です