Skip to content
Back to skills

Training And Inference

ASecurity

"Configure tf_unet model graphs, training loops, checkpoints,

  • 247 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 9, 2026
dataapi

Works with

  • api

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned September 9, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill training-and-inference --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Training And Inference?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Training And Inference
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-training-and-inference-4c0c2826/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-training-and-inference-4c0c2826)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: training-and-inference
description: "Configure tf_unet model graphs, training loops, checkpoints,
  predictions, and visual outputs."
disable-model-invocation: true
metadata:
  disco-role: operating
license: GPL 3.0
---

# training-and-inference

Use this sub-skill when the task is about `Unet`, `Trainer`, graph construction, losses, optimizers, checkpoints, prediction, accuracy, or image-visualization helpers.

This is the sub-skill for the TensorFlow 1.x model graph. If the task is really about input pipelines, file naming, or dataset loaders, switch to `../data-providers-and-launchers/SKILL.md`.

## Start here

- Read `references/api-reference.md` for signatures, tensor shapes, and return values.
- Read `references/workflows.md` for toy training and restore recipes.
- Run `scripts/smoke_train_restore.py` when you need a tiny train/save/restore/predict smoke.
- If the environment itself looks suspicious, run the root smoke helper `../../scripts/check_tf_unet_env.py` first.

## Core decisions

- Use `layers` and `features_root` to size the U-Net. `VALID` convolutions shrink the output and create an `offset`.
- Use `cost="cross_entropy"` for the default one-hot segmentation setup.
- Use `cost="dice_coefficient"` only when the task needs that segmentation-style objective.
- Pass `class_weights` or `regularizer` through `cost_kwargs` when the workflow needs imbalance handling or L2.
- Keep `summaries=False` for tiny inspection runs unless you explicitly want TensorBoard outputs.
- Crop labels with `util.crop_to_shape(label, prediction.shape)` before comparing against predictions.

## What to mention in answers

- The `Unet` constructor resets the default graph and prepares placeholders for `x`, `y`, and `keep_prob`.
- `Trainer.train(...)` expects a callable data provider that returns training and verification batches.
- `Trainer.train(...)` writes checkpoint and prediction outputs under the paths you provide.
- `predict(...)` restores from a checkpoint base path such as `model.ckpt`.
- `error_rate(...)` compares argmax classes across the channel axis.

## Bundled references

- `references/api-reference.md` — read for the public functions, classes, and shape contracts.
- `references/workflows.md` — read for the tiny smoke, checkpoint, and training recipes.
- `references/troubleshooting.md` — read when you hit TF1, shape, checkpoint, or loss-selection issues.

## Bundled script

- `scripts/smoke_train_restore.py` — run a one-step synthetic training flow when you want to verify the training loop and checkpoint restore path.

## Common safety notes

- Keep the smoke tiny and temporary. A long training run is not needed to answer routing or API questions.
- Do not assume TensorFlow 2 eager execution. This package is a graph/session workflow.
- If a checkpoint restore fails after changing `layers` or `features_root`, treat the checkpoint shape as stale and rebuild the graph.

Files in this skill

  • SKILL.md2.9 KB
  • references/api-reference.md4 KB
  • references/troubleshooting.md1.5 KB
  • references/workflows.md2.2 KB
  • scripts/smoke_train_restore.py3.3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…