AGENT SKILL

generators-and-frameworks

Use Augmentor generator APIs, array generators, framework preprocessing callables, torch-style transforms, and DataFramePipeline boundaries without making optional ML frameworks required.

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

01 前言 Front Matter

name
generators-and-frameworks
license
MIT
metadata
{ "disco-role": "operating" }
description
Use Augmentor generator APIs, array generators, framework preprocessing callables, torch-style transforms, and DataFramePipeline boundaries without making optional ML frameworks required.
disable-model-invocation
true

02 资源文件 4

03 SKILL.md 正文

Generators and framework integrations

Use this sub-skill when a task asks for Augmentor data generators, in-memory array batches, Keras/TensorFlow-style training integration, PyTorch/torchvision-style transforms, or DataFrame-backed image sources.

Route here for

  • Pipeline.keras_generator(batch_size, scaled=True, image_data_format="channels_last") from a directory-backed pipeline.
  • Pipeline.keras_generator_from_array(images, labels, batch_size, scaled=True, image_data_format="channels_last") from NumPy-like image arrays.
  • Pipeline.keras_preprocess_func() for a Keras ImageDataGenerator preprocessing callable.
  • Pipeline.torch_transform() for a callable that can be placed in a torchvision transform composition.
  • DataFramePipeline(source_dataframe, image_col, category_col, output_directory="output", save_format=None) and its pandas compatibility boundary.

Route away

  • For basic disk-backed Pipeline(...), sample(...), output directories, class-folder scanning, or save formats, use the pipeline-augmentation sub-skill.
  • For DataPipeline in-memory grouped images/masks and mask-safe array augmentation, use the masks-and-arrays sub-skill.
  • For operation selection, parameter ranges, custom operations, and validation errors, use the operation-reference sub-skill.

Required operating facts

  • Direct Augmentor generator methods are plain Python generator/callable surfaces; keras_generator, keras_generator_from_array, keras_preprocess_func, and torch_transform do not import Keras, TensorFlow, torch, or torchvision by themselves.
  • Keras/TensorFlow and torch/torchvision are optional downstream framework dependencies only when the user actually trains a model or composes framework transforms.
  • Framework training examples were reference evidence only. Use the distilled recipes in this skill; do not depend on notebooks or external datasets.
  • scaled=True converts image batches to float32 and divides pixel values by 255. scaled=False keeps unscaled image array values.
  • Choose image_data_format="channels_last" for (batch, height, width, channels) and "channels_first" for (batch, channels, height, width).
  • keras_generator_from_array requires len(images) == len(labels) and raises IndexError if they differ.
  • DataFramePipeline requires pandas, but this repository version calls Categorical.get_values(), which is missing in pandas 1.5.3 and 3.0.5. Treat DataFramePipeline as an optional legacy surface unless the user pins/patches it.

Bundled references and helper

  • Framework integration recipes covers Keras-style generators, preprocessing callbacks, torch-style transforms, and optional dependency boundaries.
  • API reference lists signatures, shape contracts, label behavior, scaling, and DataFramePipeline semantics.
  • Troubleshooting covers shape mismatches, scaling surprises, missing optional dependencies, DataFramePipeline pandas failures, and labels issues.
  • Generator smoke helper creates tiny synthetic images and arrays, exercises direct generator calls without Keras/TensorFlow, exercises torch_transform() without torchvision, and optionally checks DataFramePipeline.

Minimal decision checklist

  1. Identify the data source: disk pipeline, NumPy arrays, Keras preprocessing array stream, torch-style PIL transform, or pandas DataFrame.
  2. Pick the batch layout that matches the downstream model: channels_last or channels_first.
  3. Decide whether the model expects scaled float data (scaled=True) or raw pixel values (scaled=False).
  4. If pandas is requested, warn about the known Categorical.get_values() issue and prefer ordinary Pipeline/DataPipeline, pinning/patching, or maintaining a patched scan_dataframe.
  5. Run the bundled smoke helper in the target environment before integrating with a training loop.

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