Develop a neural network
Configure custom Dense weights, training fitted normalization, cross entropy, and SGD; inspect captured training in development and run the same program in production.
Download .aner source// Iris: Fisher (1936), UCI, CC BY 4.0. See THIRD_PARTY_DATA.md.
// Same model code in production and development; --dev enables observation.
import aner.dataset
import aner.nn
import aner.ml
import aner.dev
let split = dataset.iris().split(test: 0.2, seed: 2026)
let network = nn.sequential(seed: 42)
.dense(inputs: 4, outputs: 8,
weights: nn.random(4, 8, seed: 7, scale: 0.25),
bias: nn.zeros(1, 8))
.tanh()
.dense(inputs: 8, outputs: 3)
let pipeline = ml.classifier(network, standardize: true,
loss: "cross_entropy", optimizer: "sgd")
print(network.summary())
print(pipeline.summary())
dev.capture("Configured network", network)
let fitted = pipeline.fit(split.train(), epochs: 400, rate: 0.1)
dev.capture("Trained model", fitted)
print(fitted.evaluate(split.test()).summary())
Make it your experiment.
With Aner installed, save this program as examples/development_nn.aner inside a folder for your experiment. Open a terminal in that folder, then check and run the program.
aner check examples/development_nn.aner
aner run examples/development_nn.aner --dev nn-report
aner run examples/development_nn.aner --prodThe aner command must be on your PATH. Follow the installation guide if your terminal cannot find it.
After development, open nn-report/inspection.html in a browser for variables, references, and observations. The development guide explains report files, recording budgets, neural captures, and notebook controls.
Use a new report directory for each development run. Production is the default; --prod disables recording, and --dev records bounded observations without changing the model or list computation.
Iris and Wine are teaching datasets with their own attribution. Example outcomes are not comparative benchmarks or evidence of clinical validity.
Dataset sources & attribution