discrete-backprop
Gradient-free optimization via discrete perturbations and trit-based learning
npx skills add majiayu000/claude-skill-registry --skill discrete-backprop --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Discrete Backprop Skill **Status**: ✅ Production Ready **Trit**: +1 (PLUS - generator/executor) **Principle**: Learn without continuous gradients using {-1, 0, +1} perturbations --- ## Overview **Discrete Backprop** enables gradient-free learning for: 1. **Non-differentiable functions**: Hash lookups, conditionals, discrete choices 2. **Quantized networks**: Binary/ternary neural networks 3. **Combinatorial optimization**: Where gradients don't exist 4. **GF(3) systems**: Native trit-based learning ## Core Algorithm ``` Discrete Gradient Estimation: For each parameter θ: 1. Perturb: θ⁺ = θ + ε, θ⁻ = θ - ε 2. Evaluate: L⁺ = Loss(θ⁺), L⁻ = Loss(θ⁻) 3. Estimate: ∇θ ≈ sign(L⁺ - L⁻) → {-1, 0, +1} Trit Gradient: - If L⁺ > L⁻: move negative → trit = -1 - If L⁺ < L⁻: move positive → trit = +1 - If L⁺ ≈ L⁻: stay → trit = 0 ``` ## Python Implementation ```python import random from typing import Callable, List, Tuple from dataclasses import dataclass @dataclass class TritGradient: """Gradient represented as trit {-1, 0, +1}.""" value: int confidence: float def __post_init__(self): assert self.value in {-1, 0, 1} class DiscreteBackprop: """Gradient-free optimization using discrete perturbati
- Overview
- Core Algorithm
- Python Implementation
- Ternary Neural Network
- GF(3) Conservation
- Commands
- Integration with gay-mcp
- Advantages
- SDF Interleaving
- Primary Chapter: 1. Flexibility through Abstraction
- GF(3) Balanced Triad
- Secondary Chapters
- Connection Pattern
Run discrete optimization python -m discrete_backprop --loss "x**2 + y**2" --init "[5, 5]" --steps 100 Train ternary network python -m discrete_backprop.ternary_mlp --dataset mnist --epochs 10 Verify GF(3) conservation python -c "from discrete_backprop import GF3ConservativeOptimizer; ..."
What does the discrete-backprop skill do?
Gradient-free optimization via discrete perturbations and trit-based learning
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill discrete-backprop --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
