l0

Apply L0 regularization with Hard Concrete distributions to sparsify neural networks.

31|6|Updated Oct 19, 2025
One-click install
npx skills add https://github.com/PolicyEngine/policyengine-claude --skill l0
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: l0
Source: https://github.com/PolicyEngine/policyengine-claude/tree/main/skills/l0-skill
Command: npx skills add https://github.com/PolicyEngine/policyengine-claude --skill l0

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires l0-python.

What problem does it solve?

This Skill helps PolicyEngine create more efficient survey datasets by intelligently selecting which households to include in calculations. This leads to faster population impact calculations and smaller dataset sizes while maintaining accuracy.

Core Features & Use Cases

  • Intelligent Sampling: Provides sampling gates for household selection, feature selection, and sparse weighting.
  • Performance Optimization: Reduces the number of households needed for simulation, speeding up PolicyEngine calculations.
  • Use Case: Select 1,000 representative households from a 10,000-household survey to accelerate microsimulation without compromising accuracy.

Quick Start

Use the l0 skill to select 1,000 representative households from your data DataFrame.

Frequently Asked Questions about l0

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce neural network model size using L0 regularization?

L0 regularization applies sparsity to neural networks by learning which weights and features are essential, automatically zeroing out less important ones. This reduces model size and computational cost while maintaining accuracy, using Hard Concrete distributions in PyTorch to approximate discrete selection decisions.

Can I use L0 regularization for intelligent household sampling in survey data?

Yes. L0 regularization provides sampling gates to intelligently select representative households from survey datasets like CPS. This reduces the number of households needed for microsimulation while preserving statistical accuracy for population impact calculations.

How does L0 regularization speed up data analysis and microsimulation?

L0 regularization identifies and removes redundant features and households, shrinking datasets and neural networks. Fewer computations mean faster microsimulation runs and quicker population impact analysis without sacrificing result reliability.

What's the difference between L0 and L1/L2 regularization for sparsity?

L0 regularization directly penalizes the count of non-zero weights, learning discrete feature selection through Hard Concrete approximations. Unlike L1/L2 which shrink weights gradually, L0 produces true sparsity by automatically eliminating entire features and gates.

Do I need PyTorch to use L0 regularization for survey calibration?

Yes. L0 regularization integrates with PyTorch neural networks through l0-python dependency, enabling temperature-controlled sparsity and differentiable optimization across PolicyEngine's survey calibration and microsimulation pipelines.

What are the limitations of L0 regularization for large-scale surveys?

L0 regularization requires careful temperature tuning to balance sparsity and model performance. Extremely large surveys may need experimentation to find optimal penalty weights and gate thresholds; overly aggressive sparsity can harm accuracy.