tp4-feature-learning

Implements infinite-width GP, NTK, and muP experiments for MAML and Word2Vec replication.

75|7|Updated May 2, 2026
One-click install
npx skills add https://github.com/zjunlp/Mechanist --skill tp4-feature-learning-zjunlp
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tp4-feature-learning
Source: https://github.com/zjunlp/Mechanist/tree/main/skills/mechanism-skills/neural-feature-learning/kernel-ntk-feature-regime
Command: npx skills add https://github.com/zjunlp/Mechanist --skill tp4-feature-learning-zjunlp

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires torch, numpy, torchmeta, torchvision, and includes scripts (resource) and references (resource) components.

What problem does it solve? Replicating the Tensor Programs TP4 paper experiments requires correctly implementing infinite-width neural network limits (Gaussian Process, NTK, muP) and wiring them into MAML meta-learning and Word2Vec training pipelines, which is error-prone without a structured reference. ## Core Features & Use Cases - Infinite-Width Model Library: Provides InfGP1LP, InfNTK1LP, and FinGP1LP models plus InfSGD and InfMultiStepLR optimizers with correct infinite-width scaling. - MAML Meta-Learning: Runs finite and infinite-width MAML on Omniglot few-shot classification via train.py with the --inf flag. - Word2Vec Replication: Builds modified C Word2Vec binaries and trains finite or infinite-width embeddings on text8 and fil9 datasets. - Use Case: A researcher studying feature learning versus kernel regimes can run train_all.sh to reproduce all TP4 MAML configurations and compare finite-width baselines against GP and NTK limits. ## Quick Start Ask the assistant to set up the TP4MAML environment and run a 5-way 1-shot infinite-width MAML experiment on Omniglot.

Frequently Asked Questions about tp4-feature-learning

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

FAQPage Schema
How do I run infinite-width MAML on Omniglot?

Run python train.py --dataset omniglot --num-ways 5 --num-shots 1 --inf from the TP4MAML/meta directory after installing both requirements.txt files. The --inf flag switches the metalearner from standard MAML to InfMAML using GP or NTK limits.

What is the difference between GP, NTK, and muP limits in infinite-width networks?

The GP limit treats the network as a Gaussian Process with kernel regression, the NTK limit captures gradient-based training dynamics via the neural tangent kernel, and muP enables feature learning. This skill provides InfGP1LP and InfNTK1LP models for the first two regimes.

How do I train infinite-width Word2Vec embeddings?

Build the C binaries with make in the Word2Vec directory, prepare data with create-text8-data.sh, then run train-text8-inf.sh. The infinite-width scripts set hyperparameters appropriate for infinite-width training, and evaluate.sh scores the embeddings.

Does InfSGD work with standard PyTorch models?

InfSGD subclasses torch.optim.Optimizer and accepts standard parameter groups, so it works with regular nn.Module models. It applies learning rate scaling conventions appropriate for infinite-width NTK or muP parameterizations, with InfMultiStepLR as its compatible scheduler.

Why do infinite-width models not store explicit weights?

Infinite-width models like InfGP1LP and InfNTK1LP perform prediction through kernel computations rather than learned weight matrices. They accumulate kernel values between training and test points using functions like F00ReLU, the arc-cosine ReLU kernel.