界面已本地化;技能介绍与说明文档按所选语言由 AI 自动翻译,代码、命令、路径和专业术语保留原文,以原作者文档为准。
探索技能
效率与协作 · SKILL.md

sacred

sacred

【效率与协作】Use Sacred to configure, run, log, observe, and reproduce Python ML experiments with experiment, configuration, CLI, observer, and reproducibility workflows.

独立 GitHub 快照 · 自动分类 · 以原作者文档为准

技能说明

GitHub

name: sacred description: "Use Sacred to configure, run, log, observe, and reproduce Python ML experiments with experiment, configuration, CLI, observer, and reproducibility workflows." disable-model-invocation: true metadata: disco-role: operating license: MIT

Sacred repo skill

Use this repo skill when a task involves the Sacred Python package for experiment management: defining experiments, injecting configuration, running command-line variants, recording run metadata, storing artifacts/metrics, or making experiments reproducible.

Install and import check

Sacred is a Python package. For normal use start with:

python -m pip install sacred
python - <<'PY'
import sacred
from sacred import Experiment, Ingredient
print(sacred.__version__, Experiment, Ingredient)
PY

If importing Sacred fails with ModuleNotFoundError: No module named 'pkg_resources', install a setuptools release that still provides pkg_resources:

python -m pip install 'setuptools<81'

Run scripts/sacred_env_check.py after installation to verify importability, public signatures, a tiny in-process experiment, and optional dependency visibility without external services.

Route map

Shared references

Operating guidance

  1. Treat Sacred as an experiment wrapper around user code, not a training framework. The user supplies the ML/data code; Sacred owns configuration, command routing, observation, and reproducibility metadata.
  2. Keep experiments deterministic by recording seed, using captured _seed/_rnd, and validating dependency/source capture before comparing runs.
  3. For first-time validation, prefer a local FileStorageObserver and temporary directories before adding MongoDB, SQL, cloud, chat, or dashboard integrations.
  4. Use print_config, print_dependencies, and the bundled probe scripts as safe checks before launching expensive experiments.
  5. Do not assume optional observers or TensorFlow integration are available. Verify packages, services, credentials, and backend versions explicitly.
  6. When creating reusable project guidance, copy or adapt Sacred patterns into the target project; do not depend on the original Sacred source checkout.
我的收藏