HF RL Explorer

Task: Implement L1/L2 Regularization in PyTorch

Task: Implement L1/L2 Regularization in PyTorch: a task in Terminal-Lego-15k (Harbor dataset). Create a Python script that demonstrates how to add L1 and L2 regularization to a PyTorch neural network model without manually computing the regularization terms by iterating over parameters (for L2)…

The task

Create a Python script that demonstrates how to add L1 and L2 regularization to a PyTorch neural network model **without manually computing the regularization terms by iterating over parameters** (for L2), and with a clean reusable approach for L1.

Part of PrimeIntellect/Terminal-Lego-15k.