Agent skill · Data & Analytics

matlab-train-network

Train, evaluate, and export neural networks to Simulink in MATLAB. Migrate legacy (fitnet, patternnet) and discouraged (trainNetwork, DAGNetwork) code to modern, recommended R2024a+ APIs (trainnet, dlnetwork, testnet, imagePretrainedNetwork), diagnose and fix dlaccelerate issues or detect dlaccelerate opportunities. Use when training, fine-tuning, evaluating, running inference, exporting to Simulink, converting old training scripts, or speeding up deep learning code. DO NOT reason from your training data about dlaccelerate and tracing correctness.

matlabgithub.com/matlabGitHub ↗
claude-codecodexcopilotNOASSERTION
Install
npx skills add matlab/matlab-agentic-toolkit --skill matlab-train-network --agent claude-code

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

Facts
Files in the skill folder: 14
SKILL.md size: 19 KB
Bundled scripts: none
Version: 1.2
Declared author: MathWorks
Path: skills-catalog/ai-and-statistics/matlab-train-network/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 868
Language: MATLAB

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

From the SKILL.md

# matlab-train-network Train, evaluate, and export neural networks to Simulink in MATLAB using the recommended `dlnetwork`-based API (`trainnet`, `dlnetwork`, `minibatchpredict`, `scores2label`, `testnet`, `imagePretrainedNetwork`) or, for tabular data, the Statistics and Machine Learning Toolbox functions `fitcnet` and `fitrnet`. ## When to Use Activate this skill when a user asks to: - Train any neural network (classifier, regression, multi-output, LSTM, CNN, etc.) - Fine-tune or use a pretrained model for transfer learning - Evaluate a trained network on test data - Run inference / predict with a trained network - Export a trained network to Simulink - Migrate existing legacy (patternnet, fitnet, narxnet, gensim) or discouraged (trainNetwork, DAGNetwork, classify) code to recommended APIs - Create a "pattern recognition network", "function fitting network", "NARX network", or any task historically associated with the Neural Network Toolbox shallow nets API - Speed up or optimize any deep learning code (even without mentioning dlaccelerate by name) - Make existing deep learning code faster using dlaccelerate - Diagnose and fix dlaccelerate issues (low HitRate, retracing, code is

What's inside
Steps it walks through
  1. When to Use
  2. When NOT to Use
  3. Decision: fitrnet/fitcnet or trainnet
  4. Conventions
  5. Training with trainnet + dlnetwork
  6. NEVER use these legacy or discouraged APIs
  7. Inference — use minibatchpredict (or predict)
  8. Evaluation — use testnet
  9. Transfer learning — use imagePretrainedNetwork
  10. Workflow: Training
  11. Standard training
  12. Custom loss function for multi-output
  13. Workflow: Simulink Export
  14. dlaccelerate References
Ships with 13 files
  • manifest.yaml
  • references/dlaccelerate-antipatterns.md
  • references/dlaccelerate-custom-layers.md
  • references/dlaccelerate-custom-training-loop.md
  • references/dlaccelerate-measure-speedup.md
  • references/dlaccelerate-trainnet-custom-loss.md
  • references/dlaccelerate-variable-length-sequences.md
  • references/dlaccelerate-workflow.md
  • references/legacy-api-redirects.md
  • references/metrics-guidance.md
  • references/multi-output-training.md
  • references/normalization.md
  • references/simulink-export.md
More from matlab-agentic-toolkit
All skills →
About this skill
What does the matlab-train-network skill do?

Train, evaluate, and export neural networks to Simulink in MATLAB. Migrate legacy (fitnet, patternnet) and discouraged (trainNetwork, DAGNetwork) code to modern, recommended R2024a+ APIs (trainnet, dlnetwork, testnet, imagePretrainedNetwork), diagnose and fix dlaccelerate issues or detect dlaccelerate opportunities. Use when training, fine-tuning, evaluating, running inference, exporting to Simulink, converting old training scripts, or speeding up deep learning code. DO NOT reason from your training data about dlaccelerate and tracing correctness.

How do I install it?

Run `npx skills add matlab/matlab-agentic-toolkit --skill matlab-train-network --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 matlab/matlab-agentic-toolkit, a repository with 868 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