modal
Guides modAL-python active-learning workflows, query strategies, committees, Bayesian optimization, and optional deep integrations.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- modal
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Guides modAL-python active-learning workflows, query strategies, committees, Bayesian optimization, and optional deep integrations.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/package-overview.md3.8 KB
- 参考文档references/repo-provenance.md2.9 KB
- 参考文档references/repo-routing-metadata.json399 B
- 参考文档references/troubleshooting.md4.3 KB
- 脚本scripts/modal_environment_smoke.py5.0 KB
03 SKILL.md 正文
modAL repo skill
Use this skill when a task names modAL, modAL-python, ActiveLearner, Committee, BayesianOptimizer, active learning, uncertainty sampling, query by committee, ranked batch selection, expected error reduction, label-efficient model development, or optional modAL deep-learning integrations.
modAL is imported as modAL but installed from the package distribution modAL-python. It is a scikit-learn-oriented active-learning framework; most core workflows are CPU-only and do not require a GPU.
Start here
- Read references/repo-provenance.md when deciding whether this skill matches a source checkout or package version.
- Read references/package-overview.md for the public module map, dependency boundaries, and which optional integrations are intentionally not minimum installs.
- If install/import or dependency compatibility is uncertain, read references/troubleshooting.md and run scripts/modal_environment_smoke.py.
Minimal package check for a user environment:
python -m pip install modAL-python
python - <<'PY'
from importlib.metadata import version
import modAL
from modAL.models import ActiveLearner, Committee, CommitteeRegressor, BayesianOptimizer
print("modAL-python", version("modAL-python"), "import ok")
PY
For the historical 0.4.2 code covered by this skill, modern dependency resolvers may pick versions that are too new. If imports fail with np.float, force_all_finite, or pkg_resources errors, use the compatibility guidance in references/troubleshooting.md.
Route by task
| Task signal | Read |
|---|---|
Pool-based or stream-based active learning, ActiveLearner.query, teach, fit, single-row shapes, only_new, bootstrap, on_transformed |
sub-skills/learners-and-committees/SKILL.md |
Query by committee, Committee, CommitteeRegressor, vote, vote_proba, predict_proba, rebag, regression standard deviation |
sub-skills/learners-and-committees/SKILL.md |
| Choosing or composing uncertainty, disagreement, batch, density, expected-error, multilabel, selector, or custom query strategies | sub-skills/query-strategies/SKILL.md |
BayesianOptimizer, PI/EI/UCB acquisition functions, bounded objective-evaluation loops, or get_max() tracking |
sub-skills/bayesian-optimization/SKILL.md |
DeepActiveLearner, skorch/PyTorch estimators, MC dropout, modAL.dropout, Keras/TensorFlow examples, or optional backend imports |
sub-skills/deep-and-optional-integrations/SKILL.md |
Operating rules
- Treat modAL strategies as callables. A learner's
querymethod callsquery_strategy(self, X_pool, **kwargs)and returns selected indices plus the selected rows; metrics are available only when the strategy returns them. - For classical active learning, start with a fitted scikit-learn estimator or pass
X_trainingandy_trainingso modAL can fit during learner initialization. - Use probability-based strategies only with estimators that implement
predict_proba; route regression uncertainty to regressors that provide predictive standard deviation or to committee-regressor disagreement. - Preserve row shapes when teaching queried samples. For NumPy data, a single queried sample normally needs
X_pool[idx].reshape(1, -1)andy_pool[idx].reshape(1,). - Keep optional deep workflows explicit. The core modAL active-learning workflow is CPU-friendly; Keras/TensorFlow examples and CUDA-specific behavior require separate installation and smoke checks.
- Do not rely on original repository examples or tests at runtime. This skill bundles runnable smoke helpers under
scripts/and sub-skillscripts/directories.
Bundled checks
Run these from any current working directory in an environment with modAL installed:
python path/to/modal/scripts/modal_environment_smoke.py
python path/to/modal/scripts/modal_environment_smoke.py --include-optional-deep
Sub-skills contain deeper workflow-specific smoke helpers:
- sub-skills/learners-and-committees/scripts/active_learning_smoke.py
- sub-skills/learners-and-committees/scripts/committee_smoke.py
- sub-skills/query-strategies/scripts/query_strategy_smoke.py
- sub-skills/bayesian-optimization/scripts/bayesian_optimizer_smoke.py
- sub-skills/deep-and-optional-integrations/scripts/dropout_inspection.py
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).