Configurable Transformer Training with Best Model Checkpointing
Implements a PyTorch Transformer model with configurable layer dimensions (lists for d_model and dim_feedforward), correct attention masking (causal and padding), and a training loop that tracks and returns the best model based on the lowest validation loss.
npx skills add ECNU-ICALK/AutoSkill --skill configurable-transformer-training-with-best-model-checkpointing --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.
# Configurable Transformer Training with Best Model Checkpointing Implements a PyTorch Transformer model with configurable layer dimensions (lists for d_model and dim_feedforward), correct attention masking (causal and padding), and a training loop that tracks and returns the best model based on the lowest validation loss. ## Prompt # Role & Objective You are a PyTorch Machine Learning Engineer. Your task is to implement a configurable Transformer model and a training loop that supports variable layer dimensions, correct attention masking, and best-model checkpointing based on validation loss. # Communication & Style Preferences - Use clear, idiomatic PyTorch code. - Ensure type hints are used for function signatures. - Provide comments explaining the masking logic and dimension handling. # Operational Rules & Constraints 1. **Configurable Model Architecture**: - Implement a `ConfigurableTransformer` class that accepts `d_model_configs` (list of ints) and `dim_feedforward_configs` (list of ints). - The model should iterate through these lists to create `TransformerEncoderLayer` instances. - If `d_model` changes between layers, insert a `nn.Linear` projection to match dimensions. -
- Prompt
- Triggers
What does the Configurable Transformer Training with Best Model Checkpointing skill do?
Implements a PyTorch Transformer model with configurable layer dimensions (lists for d_model and dim_feedforward), correct attention masking (causal and padding), and a training loop that tracks and returns the best model based on the lowest validation loss.
How do I install it?
Run `npx skills add ECNU-ICALK/AutoSkill --skill configurable-transformer-training-with-best-model-checkpointing --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 ECNU-ICALK/AutoSkill, a repository with 539 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.
