Skip to content
Back to skills

Training And Optimization

ASecurity

"Train Sonnet modules with TensorFlow 2 GradientTape, Sonnet

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

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-optimization --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Training And Optimization?

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

Security grade badge for Training And Optimization
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-training-and-optimization-arex-skill/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-training-and-optimization-arex-skill)

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-optimization
description: "Train Sonnet modules with TensorFlow 2 GradientTape, Sonnet
  optimizers, metrics, and tiny local smoke loops."
disable-model-invocation: true
metadata:
  disco-role: operating
license: Apache 2.0
---

# Sonnet Training and Optimization

Use this sub-skill for TensorFlow 2 training loops around Sonnet modules. Sonnet provides modules, optimizers, and small metrics; it does not provide a Keras-style trainer, data pipeline, checkpoint manager, or distributed all-reduce policy.

## Start here

- [references/optimizer-api.md](references/optimizer-api.md): optimizer signatures, state behavior, dense/sparse updates, validation errors.
- [references/training-workflows.md](references/training-workflows.md): eager and `tf.function` loop recipes, metrics, and no-download data fixtures.
- [references/troubleshooting.md](references/troubleshooting.md): empty variables, `None` gradients, dtype/length mismatches, stale optimizer state, and stagnant loss.
- [scripts/sonnet_tiny_training_smoke.py](scripts/sonnet_tiny_training_smoke.py): synthetic training loop adapted from the MNIST example pattern.

## Boundaries

- Custom module construction: [../module-authoring/SKILL.md](../module-authoring/SKILL.md).
- Built-in layer/net choices: [../layers-and-nets/SKILL.md](../layers-and-nets/SKILL.md).
- Functional optimizers: [../functional-transforms/SKILL.md](../functional-transforms/SKILL.md).
- Distribution/export: [../serialization-and-distribution/SKILL.md](../serialization-and-distribution/SKILL.md).

## Core workflow

Run a first forward pass, collect `model.trainable_variables`, compute scalar loss under `tf.GradientTape`, call `tape.gradient(loss, variables)`, then call `optimizer.apply(gradients, variables)`.

Files in this skill

  • SKILL.md1.7 KB
  • references/optimizer-api.md1.3 KB
  • references/training-workflows.md1.2 KB
  • references/troubleshooting.md1.3 KB
  • scripts/sonnet_tiny_training_smoke.py1.2 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…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.