executing-plans
executing-plans
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
sonnetUse DeepMind Sonnet for TensorFlow 2 modules, layers, training loops, functional transforms, serialization, and distribution workflows.
Independent GitHub snapshot · Automated classification · Original documentation governs
Use this repo skill when a task involves DeepMind Sonnet (dm-sonnet, imported
as sonnet or snt) for TensorFlow 2 neural-network research code: custom
modules, built-in layers and nets, manual training loops, RNNs, functional
transforms, checkpoints, SavedModel export, mixed precision, or TensorFlow
distribution helpers.
Sonnet is intentionally small and unopinionated. It provides composable
Module objects, built-in module families, and optimizers, but it does not
provide a full training framework, dataset pipeline, experiment runner, or
serving stack.
python -m pip install tensorflow dm-sonnet
import tensorflow as tf
import sonnet as snt
print("TensorFlow", tf.__version__)
print("Sonnet", snt.__version__)
print(snt.nets.MLP([16, 4])(tf.ones([2, 8])).shape)
Run scripts/check_sonnet_install.py when you need a no-download smoke check for importability, device visibility, lazy variables, a tiny optimizer step, and basic RNN construction.
| If the task asks about... | Read this sub-skill | Why |
|---|---|---|
Custom snt.Module classes, @snt.once, lazy variables, names, Sequential, Deferred, BatchApply, or snt.build | sub-skills/module-authoring/SKILL.md | Owns Sonnet's core module programming model and composition contracts. |
Built-in layers, normalization, initializers, metrics, regularizers, snt.nets.MLP, ResNet, Cifar10ConvNet, or VQ-VAE modules | sub-skills/layers-and-nets/SKILL.md | Owns constructor signatures, shape rules, state behavior, and layer/net smoke checks. |
tf.GradientTape training loops, snt.optimizers.*, optimizer.apply, tiny local training checks, or metric accumulation | sub-skills/training-and-optimization/SKILL.md | Owns object-oriented Sonnet optimization and safe training-loop recipes. |
RNNCore, LSTM, GRU, DeepRNN, dynamic_unroll, static_unroll, trainable state, or ConvLSTM | sub-skills/sequence-and-rnn/SKILL.md | Owns sequence shape/state conventions and recurrent troubleshooting. |
snt.functional.variables, transform, transform_with_state, grad, value_and_grad, jit, device_put/get, or functional optimizers | sub-skills/functional-transforms/SKILL.md | Owns Sonnet's TensorFlow-based Haiku/JAX-like functional API. |
TensorFlow checkpoints, SavedModel export/load, Keras/pickle caveats, XLA, mixed precision, snt.distribute.Replicator, TPU, or cross-replica BatchNorm | sub-skills/serialization-and-distribution/SKILL.md | Owns persistence, export, distribution, and backend limitations. |
sonnet (import sonnet as snt), not private
implementation modules.Linear, channel dimension for convolution/normalization, and time-major
sequence layout for RNN unroll helpers.tf.GradientTape plus optimizer.apply(gradients, variables) for
object-oriented Sonnet training loops, or use snt.functional only when the
task explicitly wants stateless-style init/apply workflows.