协作头脑风暴
brainstorming
在实现前澄清需求、探索设计选择,并形成清晰的开发方向。
neural-network-building-blocks【开发与工程】Use this sub-skill for MLAlgorithms NeuralNet construction, activations, losses, parameters, constraints, regularizers, optimizers, convolutional/recurrent layers, and DQN wiring.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this sub-skill when a task asks for the custom MLAlgorithms neural-network stack: how to build a NeuralNet, choose layers or optimizers, debug training phases and shapes, or adapt the repo's MLP/CNN/RNN/LSTM/DQN examples into shorter checks. The implementation is educational and CPU-only, with no external training service or model hub dependency.
../classical-estimators/SKILL.md.../unsupervised-and-reduction/SKILL.md.Confirm the package imports the neural stack you need:
from mla.neuralnet import NeuralNet
from mla.neuralnet.layers import Dense, Activation, Dropout
from mla.neuralnet.optimizers import Adam
Choose the architecture family:
Dense + Activation.Convolution, MaxPooling, Flatten, Dense.RNN or LSTM, optionally followed by TimeDistributedDense or TimeStepSlicer.mla.rl.dqn.DQN with a user-provided neural model factory.Use explicit one-hot labels for categorical_crossentropy, and remember that NeuralNet uses a separate optimizer.setup(self) step when fit starts.
Run scripts/run_neural_smoke.py --workflow all for a short no-display check.
NeuralNet takes a list of layers plus an optimizer and a loss name. The container sets up layers, performs forward/backward passes, and delegates parameter updates to the optimizer.
from mla.neuralnet import NeuralNet
from mla.neuralnet.layers import Dense, Activation
from mla.neuralnet.optimizers import Adam
model = NeuralNet(
layers=[Dense(16), Activation("relu"), Dense(1)],
optimizer=Adam(),
loss="mse",
batch_size=32,
max_epochs=5,
metric="mse",
)
Use Convolution, MaxPooling, Flatten, and Dense for the repo's MNIST-style example. The ConvNet expects image tensors shaped like (n_samples, n_channels, height, width).
Use RNN or LSTM for sequence problems. The classes accept return_sequences=True by default, which is helpful for per-time-step outputs. TimeDistributedDense applies a dense layer to each time step.
DQN is a lightweight training loop that asks the user to supply a model factory. It is designed around legacy Gym-style reset()/step() interactions and should be treated as an integration recipe rather than a production RL stack.
references/api-reference.md for exact constructor signatures and output/shape contracts.references/workflows.md for dense/CNN/RNN/DQN recipes and validation advice.references/neural-workflows.md for longer CNN and sequence reference workflows.references/rl-dqn.md before touching CartPole or other Gym environments.references/troubleshooting.md when training stalls, shapes break, or Gym/NumPy compatibility drifts.scripts/run_neural_smoke.py --workflow mlp or --workflow all for a small installed-package check.