Skip to content
Back to skills

Model Internals

ASecurity

"Explain and verify the photo2cartoon generator, discriminator,

  • 247 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 8, 2026
toolspythonbashgit

Works with

  • cli

Security analysis

A100/100

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

Scanned September 8, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill model-internals --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Model Internals?

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

Security grade badge for Model Internals
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-model-internals-3db04449/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-model-internals-3db04449)

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: model-internals
description: "Explain and verify the photo2cartoon generator, discriminator,
  normalization layers, face-ID feature path, tensor utilities, and checkpoint
  structure."
disable-model-invocation: true
metadata:
  disco-role: operating
license: MIT
---

# Model Internals

Use this sub-skill for the model core only: architecture, forward signatures, normalization layers, checkpoint contents, and safe synthetic verification.

## Start here

- [Architecture reference](references/architecture-reference.md) for generator/discriminator tuples, hourglass topology, Soft-AdaLIN / LIN behavior, CAM heatmaps, and verified smoke shapes.
- [Training object reference](references/training-object-reference.md) for `UgatitSadalinHourglass`, losses, optimizer setup, checkpoint keys, and save/load behavior.
- [Face ID loss reference](references/face-id-loss.md) for `FaceFeatures`, MobileFaceNet cropping, 112×112 embeddings, and cosine-distance loss.
- [Image and tensor utilities](references/image-and-tensor-utils.md) for normalization range, CAM rendering, and helper semantics.
- [Troubleshooting](references/troubleshooting.md) for shape mismatch, checkpoint key errors, deprecated `F.upsample`, device mismatch, and missing face-ID assets.
- [Synthetic smoke](scripts/model_forward_smoke.py) for safe forward checks and optional checkpoint/face-ID validation.

## Route elsewhere

- Inference commands, asset download steps, and end-user cartoon generation workflows -> `../portrait-inference/`
- Face detection, alignment, crop, and segmentation details -> `../preprocessing/`
- Dataset layout, preprocessing batches, CLI training, and long-running optimization -> `../data-and-training/`

## What this sub-skill covers

- `ResnetGenerator`, `Discriminator`, `HourGlass`, `HourGlassBlock`, `ResnetBlock`, `ResnetSoftAdaLINBlock`, `SoftAdaLIN`, `adaLIN`, and `LIN`
- Generator and discriminator return tuples: `(out, cam_logit, heatmap)`
- CAM logits and heatmap interpretation
- Tensor normalization range used by the repo
- Face-ID embedding path through `MobileFaceNet(512)`
- Training checkpoint contents and safe load checks
- Safe synthetic verification only; no downloads, no training, no destructive writes

## Practical commands

```bash
python scripts/model_forward_smoke.py --help
python scripts/model_forward_smoke.py --repo-root /path/to/photo2cartoon
python scripts/model_forward_smoke.py --repo-root /path/to/photo2cartoon --checkpoint /path/to/checkpoint.pt --face-model /path/to/model_mobilefacenet.pth
```

Files in this skill

  • SKILL.md2.5 KB
  • references/architecture-reference.md4.5 KB
  • references/face-id-loss.md2 KB
  • references/image-and-tensor-utils.md2.5 KB
  • references/training-object-reference.md3.8 KB
  • references/troubleshooting.md2.8 KB
  • scripts/model_forward_smoke.py16.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…

Newsletter

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