counterfactual-and-certification
Use AIX360 for contrastive CEM/CEM-MAF explanations, black-box certification, GLANCE recourse, and order-constrained optimal-transport matching.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- counterfactual-and-certification
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Use AIX360 for contrastive CEM/CEM-MAF explanations, black-box certification, GLANCE recourse, and order-constrained optimal-transport matching.
- disable-model-invocation
- true
02 资源文件 3
- 参考文档references/api-reference.md12.1 KB
- 参考文档references/troubleshooting.md8.1 KB
- 参考文档references/workflows.md6.4 KB
03 SKILL.md 正文
Counterfactual and certification
Use this route when the request is about a contrastive explanation, a pertinent positive or negative, actionable recourse, a robustness/trust-region certificate, or an alternative matching under transport/order constraints. The route covers AIX360 0.3.0 APIs; it does not promise that every optional backend can be installed in the current environment.
Route by goal
- CEM / CEM-MAF: image or array contrastive explanations. A pertinent positive (PP) retains the minimum sufficient content for the original class; a pertinent negative (PN) is added content whose presence changes the class. Use the API and legacy-backend caveats in api-reference.md.
- Ecertify: certify a scalar quality/fidelity callable in a neighborhood of one instance. This is black-box, query-budgeted, and probabilistic/empirical; it is not an exhaustive proof over arbitrary data domains.
- GLANCE: generate local counterfactuals or global subgroup actions for a
binary tabular model. Make favorable class
1, numeric/categorical columns, immutable features, and the cost definition explicit before fitting. - OTMatching: produce alternative transport plans and salient changed positions while preserving row/column marginals within the configured error tolerance. The matching and costs must already be prepared by the caller.
Do not route here
- LIME, SHAP, GroupedCE, or nearest-neighbor contrastive explanations go to ../local-black-box/SKILL.md.
- Rules, prototypes, IMD, or TED go to ../interpretable-models/SKILL.md.
- Time-series explanations go to ../time-series/SKILL.md.
- Dataset-loader ownership and download lifecycle go to ../datasets-and-metrics/SKILL.md.
Required inputs
Before invoking an algorithm, record:
- The input representation and shape, target/favorable class, and the model prediction interface.
- Which features or pixels may change, hard lower/upper bounds, and whether categorical changes, monotonic directions, or immutable columns must be enforced outside the algorithm.
- The expected output: counterfactual array, action table, certificate width, or list of matching alternatives; also record the acceptance test.
- Optional-dependency and network policy. Never start a model, image, GAN, embedding, or dataset download as an implicit side effect.
Safe decision flow
- Validate shapes, dtypes, finite values, class semantics, and constraints with a tiny local fixture. For GLANCE, apply candidate actions and re-run the model; for matching, check non-negativity and marginal sums.
- Prefer the CPU-oriented GLANCE action/cost primitives, a small synthetic Ecertify quality function, or a tiny transport plan for verification.
- Treat contrastive image execution as optional until the TensorFlow 1.x and Keras stack, model assets, and input preprocessing have been independently confirmed. Do not substitute a modern TensorFlow result for that historical path.
- Treat a returned candidate as a proposal: re-predict it, check bounds and actionability, and report fewer-than-requested or no-solution outcomes.
- Summarize approximation, random seeds, query budgets, dependency failures, and unverified paths with the result.
Output and handoff
Return the requested artifact together with the input shape, target/favorable class, constraint policy, model-output adapter, dependency status, and a post-call validation result. Distinguish a valid candidate from a failed or empty search. For a certificate, include width, strategy, query budget, and confidence interpretation; for GLANCE, include effectiveness and cost semantics; for matching, include marginal residuals and salient positions.
See api-reference.md for signatures and output contracts, workflows.md for no-network recipes, and troubleshooting.md for recovery boundaries.
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).