AGENT SKILL

parameters-random-and-utilities

Use when controlling imgaug stochastic parameters, seeds, deterministic replay, dtype conversion, sample data, grids, or utility helpers.

License 许可
MIT
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
parameters-random-and-utilities
license
MIT
metadata
{ "disco-role": "operating" }
description
Use when controlling imgaug stochastic parameters, seeds, deterministic replay, dtype conversion, sample data, grids, or utility helpers.
disable-model-invocation
true

02 资源文件 4

03 SKILL.md 正文

Parameters, Randomness, and Utilities

Use this sub-skill when the task is about how imgaug samples augmentation parameters, controls reproducibility, handles dtype/range conversion, loads built-in example data, or uses utility functions such as resizing, grids, and display helpers.

What this sub-skill covers

  • Parameter shortcuts: scalar values, (a, b) tuples, lists, and imgaug.parameters.StochasticParameter objects.
  • Distribution objects such as Choice, Uniform, Normal, and Clip.
  • Seeds, RNG, deterministic replay, and deprecated random_state/deterministic API warnings.
  • Dtype conversion, clipping, range checks, and compatibility with current NumPy.
  • Sample quokka images and annotations from imgaug.data.
  • Utility helpers: resize, draw grids, and headless-safe visualization alternatives.

What it does not cover

Typical triggers

  • “How do tuple parameters work in imgaug?”
  • “Make this imgaug pipeline reproducible.”
  • “Why does imgaug warn about random_state?”
  • “Use the built-in quokka image as a tiny fixture.”
  • “Fix dtype clipping or NumPy import errors.”

Fast path

  1. Read references/parameters-and-rng.md for stochastic parameters and reproducibility.
  2. Read references/data-and-dtype-utilities.md for dtype helpers, resizing, grids, and sample data.
  3. Run scripts/smoke_parameters_and_data.py to verify parameter sampling, quokka data, and dtype conversion.
  4. Read references/troubleshooting.md for NumPy 2, deprecations, dtype range, and display failures.

Core parameter pattern

Many augmenter parameters accept flexible forms:

import imgaug.augmenters as iaa
import imgaug.parameters as iap

# Shortcut for a uniform blur range.
blur = iaa.GaussianBlur(sigma=(0.0, 3.0))

# Explicit stochastic distribution clipped to a safe range.
param = iap.Clip(iap.Normal(1.0, 0.1), 0.1, 3.0)
blur2 = iaa.GaussianBlur(sigma=param)

Reproducibility pattern

Use a seed on an augmenter or convert a pipeline to deterministic form when the same sampled transform must be replayed.

seq = iaa.Sequential([iaa.Fliplr(0.5), iaa.Add((0, 5))], seed=1)
det = seq.to_deterministic()
out_a = det(images=images)
out_b = det(images=images)

For aligned images and annotations, a single call containing every augmentable remains the safest pattern.

Utility warning signs

  • AttributeError involving np.sctypes: install numpy<2 for imgaug 0.4.0.
  • Unexpected clipping or rounding: inspect dtype helpers and value ranges before conversion.
  • Display failure on a server: avoid ia.imshow; write grids to image files instead.
  • Deprecation warnings around random_state or deterministic: prefer seed, RNG, and to_deterministic() patterns.

04 同仓库更多 Skills

VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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).

★ 351