deep-learning
Assemble and debug ML-From-Scratch NeuralNetwork, layers, activations, losses, optimizers, MLP/CNN/RNN, and generative model-building workflows.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- deep-learning
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Assemble and debug ML-From-Scratch NeuralNetwork, layers, activations, losses, optimizers, MLP/CNN/RNN, and generative model-building workflows.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/api-reference.md8.3 KB
- 参考文档references/troubleshooting.md6.7 KB
- 参考文档references/workflows.md8.0 KB
- 脚本scripts/run_cnn_smoke.py4.2 KB
- 脚本scripts/run_mlp_smoke.py3.7 KB
03 SKILL.md 正文
deep-learning
Use this sub-skill when a task involves ML-From-Scratch's neural-network framework: NeuralNetwork, deep-learning layers, activation/loss/optimizer selection, MLP/CNN/RNN model assembly, or advanced generative model builders.
Route here for
- Building or debugging
NeuralNetwork(optimizer, loss, validation_data=None)workflows. - Selecting and ordering layers such as
Dense,Activation,Dropout,Flatten,Conv2D, pooling,BatchNormalization,RNN,Reshape, andUpSampling2D. - Choosing optimizers, losses, and activations for small CPU examples.
- Diagnosing shape errors in MLP, CNN, RNN, autoencoder, GAN, or DCGAN-style builders.
- Creating a tiny CPU smoke check that imports the installed package and performs one deterministic epoch.
Route away
- Classical supervised estimators such as tree, regression, SVM, Naive Bayes, perceptron, or GMM classifier workflows: use
supervised-learning. - Clustering, dimensionality reduction, association mining, and non-neural unsupervised estimators: use
unsupervised-learning. - Gym environment loops, replay memory, epsilon decay, CartPole training/play loops, and DQN compatibility: use
reinforcement-learning. This sub-skill only covers the neural model-builder portion.
Operating procedure
- Treat the installed
mlfromscratchpackage as the runtime source of truth. Do not require source-checkout reads or original demo scripts during user work. - Start with the framework contracts in references/api-reference.md, especially input shape conventions and exact constructor names.
- Use references/workflows.md for MLP, CNN, RNN, autoencoder, GAN/DCGAN, and fast validation recipes.
- If a user reports an exception or unexpected output, diagnose from references/troubleshooting.md before changing model code.
- For quick environment validation, run one of the bundled scripts:
python scripts/run_mlp_smoke.pypython scripts/run_cnn_smoke.py
High-signal rules
- The first shape-bearing layer must receive
input_shapewithout the batch dimension: e.g.Dense(..., input_shape=(n_features,)),Conv2D(..., input_shape=(channels, height, width)), orRNN(..., input_shape=(timesteps, input_dim)). CrossEntropyexpects one-hot encoded targets with the same final class dimension as the network output. For multiclass classification, finish withDense(n_classes)thenActivation('softmax').- The framework expects channels-first image batches for convolution:
(n_samples, channels, height, width), not channels-last. - Add transform layers in data-flow order: shape-bearing first layer, activation after affine/convolution/recurrent output,
Flatten()before dense layers after image-like tensors. - Full demos can be slow and plot by default. Prefer the bundled smokes or reduce epochs/sample counts and set a headless Matplotlib backend before importing plotting libraries.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).