Skip to content
Back to skills

Stochastic Vi Chain

ASecurity

Run bounded constant-step noisy stochastic optimization chains that model stochastic VI iterates as a Markov process around an optimum.

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

Security analysis

A100/100

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

Scanned September 9, 2026

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

Installs into .claude/skills of the current project.

Are you the author of Stochastic Vi Chain?

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

Security grade badge for Stochastic Vi Chain
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-stochastic-vi-chain/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-stochastic-vi-chain)

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: stochastic_vi_chain
description: Run bounded constant-step noisy stochastic optimization chains that model stochastic VI iterates as a Markov process around an optimum.
---

# Stochastic VI Chain

Use this skill when a recovery or implementation needs deterministic evidence for the paper's view of stochastic VI optimization as a Markov chain. Do not use it to claim full probabilistic-programming VI training unless the gradient oracle is connected to a real model.

## Inputs

- `chains`: positive number of independent optimization runs.
- `iterations`: positive number of stochastic update steps.
- `dimensions`: positive variational parameter dimension.
- `learning_rate`, `noise_scale`, `seed`, and optional optimum vector.

## Outputs

- JSON containing `iterates`, `gradients`, `initial_parameters`, `optimum`, and run metadata.
- Chain-major arrays: `chains x iterations x dimensions`.

## Workflow

1. Choose or supply a known optimum.
2. Initialize chains away from the optimum with deterministic seed control.
3. At each step, evaluate a negative-quadratic gradient plus zero-mean Gaussian noise.
4. Apply a constant-step stochastic gradient update and record the trace.
5. Use the trace for downstream Rhat, ESS, MCSE, and iterate-averaging checks.

## Validation

Run:

```bash
python3 scripts/simulate_chains.py --chains 4 --iterations 120 --dimensions 5 --output /tmp/stochastic_vi_chains.json
python3 tests/test_simulate_chains.py
```

## Limitations

The bundled simulator is a reduced proxy for optimizer dynamics. It preserves stochastic iterate behavior and trainable-parameter updates but does not replace a full model-specific ELBO gradient.

Files in this skill

  • SKILL.md1.6 KB
  • scripts/robust_svi.py3.9 KB
  • scripts/simulate_chains.py3.6 KB
  • tests/test_stochastic_vi_chain.py725 B

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.