Agent skill

discrete-backprop

Gradient-free optimization via discrete perturbations and trit-based learning

majiayu000github.com/majiayu000GitHub ↗
claude-codeMIT
Install
npx skills add majiayu000/claude-skill-registry --skill discrete-backprop --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 11 KB
Bundled scripts: none
Version: 1.0.0
Path: skills/ai-ml/discrete-backprop/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 534
Language: HTML

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# 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

What's inside
Steps it walks through
  1. Overview
  2. Core Algorithm
  3. Python Implementation
  4. Ternary Neural Network
  5. GF(3) Conservation
  6. Commands
  7. Integration with gay-mcp
  8. Advantages
  9. SDF Interleaving
  10. Primary Chapter: 1. Flexibility through Abstraction
  11. GF(3) Balanced Triad
  12. Secondary Chapters
  13. Connection Pattern
Ships with 1 file
  • metadata.json
Commands it runs
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; ..."
More from claude-skill-registry
All skills →
About this skill
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.

Keep going