Skip to content
Back to skills

Inverse Factorization Contracts

ASecurity

Build and validate ordered inverse factorization contracts for amortized inference networks from generated inverse graph parents.

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

Security analysis

A100/100

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

Scanned September 9, 2026

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

Installs into .claude/skills of the current project.

Are you the author of Inverse Factorization Contracts?

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

Security grade badge for Inverse Factorization Contracts
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-inverse-factorization-contracts/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-inverse-factorization-contracts)

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: inverse_factorization_contracts
description: Build and validate ordered inverse factorization contracts for amortized inference networks from generated inverse graph parents.
---

# Inverse Factorization Contracts

Use this skill after graph inversion has produced inverse parent sets and before building a recovery harness or inference-network parameterization. The skill turns graph edges into ordered factor contracts for `q(z | x)`.

## Inputs

- `inverse_parents`: mapping from latent variable to inverse parents.
- `latents` and `observed` variable lists.
- `elimination_order` from NaMI.
- Optional `families` mapping from variable to distribution family.
- Optional complete sample values for feature-vector construction.

## Outputs

- Ordered contracts with factor variable, parents, latent parents, observed parents, and family.
- A validation report with contract issues.
- Deterministic feature vectors for each factor when values are supplied.

## Workflow

1. Reverse the elimination order to obtain sampling order.
2. Build one factor contract for each latent variable.
3. Split parents into latent and observed parent lists.
4. Attach support-compatible families, defaulting to `gaussian`.
5. Validate that observations are only parents, never factor variables.
6. Use parent order from the contract when constructing feature vectors.

## Validation

Run:

```bash
python tests/test_contracts.py
```

The tests are standard-library only.

## Limitations

The contracts do not select hidden-layer sizes or neural architectures. They specify the structural interface that a neural, MADE-style, or reduced linear student must respect.

Files in this skill

  • SKILL.md1.6 KB
  • scripts/factor_contracts.py4 KB
  • tests/test_contracts.py1.7 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…