Skip to content
Back to skills

Factorized Score Composition

ASecurity

Compose F-NPSE and PF-NPSE posterior scores from learned score terms and prior corrections for SBI.

  • 247 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 9, 2026
testingpythonbash

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

Installs into .claude/skills of the current project.

Are you the author of Factorized Score Composition?

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

Security grade badge for Factorized Score Composition
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-factorized-score-composition/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-factorized-score-composition)

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: factorized_score_composition
description: Compose F-NPSE and PF-NPSE posterior scores from learned score terms and prior corrections for SBI.
---

# Factorized Score Composition

Use this skill when implementing the central compositional step from F-NPSE or PF-NPSE. It turns score estimates for individual observations or small observation groups into one score for a multi-observation posterior approximation.

Do not use this skill for denoising score training or for sampling. It expects a score predictor to already exist and returns a composed score that a sampler can consume.

## Inputs

- Current `theta`.
- Time index `t` and total diffusion levels `T`.
- Observations for F-NPSE or groups for PF-NPSE.
- Prior score function, such as `-theta` for a standard normal prior.
- Score predictor for one observation or one group.

## Outputs

- Composed score vector.
- Metadata with method, observation count, group count, and prior coefficient.
- Per-term score diagnostics that can be logged for recovery evidence.

## Workflow

For F-NPSE, compute:

```text
((1 - n) * (T - t) / T) * grad_log_prior(theta) + sum_j s(theta, t, x_j)
```

For PF-NPSE, partition observations into groups of size at most `m`, compute `k` groups, and use the same formula with `k` replacing `n` and group score predictions replacing single-observation scores.

## Validation

Run:

```bash
python /share/project/yuyang/workspace/Paper2Skills/Distiller/skills/module-to-skill/scripts/validate_skill_tree.py <skill_dir> --run-tests
```

The tests verify the paper formulas, grouping behavior, and invariance to group order for deterministic score terms.

## Limitations

This skill does not decide whether score estimates are accurate. It only enforces the algebraic composition contract from the paper.

Files in this skill

  • SKILL.md1.8 KB
  • scripts/score_composition.py5.5 KB
  • tests/test_score_composition.py1.4 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.