Parametric umap

From lza6/Armor-piercing-system-prompts · View interactive version

Parametric umap is an AI agent skill from the GitHub repository lza6/Armor-piercing-system-prompts. Use ParametricUMAP for TensorFlow/Keras-backed neural embeddings, reconstruction, save/load, callbacks, landmarks, and ONNX caveats.

How to use this skill

Skill file

Parametric UMAP

Use this sub-skill when the task is about the neural ParametricUMAP path

rather than the base umap.UMAP estimator.

Route Here For

Route Elsewhere

core-embedding.

plotting-diagnostics.

sibling sub-skills, not this one.

Start Fast

  1. Run CODE0

before training. It reports whether umap, TensorFlow, Keras, and the

optional Torch/torchvision ONNX path are available, and it explains the root

import shim when TensorFlow is absent.

  1. If TensorFlow/Keras are missing, do not expect `from umap import

ParametricUMAP` to train. In that case the root package may expose a dummy

class whose constructor raises ImportError.

  1. Keep custom encoder output units aligned with n_components, and keep

decoder output shape aligned with dims when reconstruction is enabled.

  1. CPU-only TensorFlow is enough for correctness checks; GPU support is

optional and only affects speed.

Quick Pattern

from umap.parametric_umap import ParametricUMAP

model = ParametricUMAP(n_components=2, verbose=True)
embedding = model.fit_transform(X)

For a custom network or reconstruction, read the bundled references before

writing code:

for recipes.

signatures and parameter notes.

shape, save/load, landmark, and ONNX recovery steps.

Decision Points

TensorFlow is missing, the root import may still expose ParametricUMAP, but

constructing it raises ImportError.

decoder; make sure the encoder output width equals n_components.

data scale and decoder output compatible with the chosen loss, and use

reconstruction_validation when you want held-out reconstruction checks.

keras_fit_kwargs.

add_landmarks(...) or pass landmark_positions into fit/fit_transform.

preserve the Keras objects and pickle state; to_ONNX() is an encoder-only

export path and requires Torch extras.

Keep in Mind

in the shape the encoder expects.

parametric_reconstruction=True; otherwise it falls back to the base UMAP

inverse path.

sub-skill if you need to render the curve.

round-tripping a model directory.

References

for end-to-end recipes covering embedding, reconstruction, callbacks,

save/load, landmarks, and ONNX caveats.

constructor, method signatures, and shape/parameter constraints.

concrete failure modes and recovery steps.

whenever you need a safe import/dependency summary or a tiny smoke check.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.