All examples
Neural networks

Dense model parameters and detached metrics

Configure initialization, optimizer, dropout and held out validation using explicit native model settings.

neural_model_reference.aner
// Explicit model/configuration variables; no files are created.
import aner.dataset
import aner.nn
import aner.ml

let parts = dataset.iris().partition(validation: 0.2, test: 0.2, seed: 81)
let network = nn.sequential(seed: 42)
    .dense(inputs: 4, outputs: 16, initialization: "he").relu()
    .dropout(probability: 0.2)
    .dense(inputs: 16, outputs: 3, initialization: "xavier")
let plan = ml.classifier(network, standardize: true,
    loss: "cross_entropy", optimizer: "adam")
    .on(device: "cpu", precision: "Float64", policy: "preserve")
    .dropout_seed(seed: 2026)
let config = ml.training(epochs: 20, batch: 16, rate: 0.01, seed: 91)
    .validation(parts.validation()).select_best(false)
let fitted = plan.fit(parts.train(), config: config)
print(fitted.summary())
print(fitted.evaluate(parts.test()).summary())

Make it your experiment.

Use Aner 0.0.5 or newer. Save this program as examples/neural_model_reference.aner inside a folder for your experiment. Open a terminal in that folder, then check and run the program.

Terminal
aner check examples/neural_model_reference.aner
aner run examples/neural_model_reference.aner

The aner command must be on your PATH. Follow the installation guide if your terminal cannot find it.

Requires Aner 0.0.5 or newer. Uses complete synthetic tensors and the native classical ML runtime. No dataset download, credentials or external service is required. The guide documents exact expected results and all input constraints.

Credential setup
aner check examples/neural_model_reference.aner
aner run examples/neural_model_reference.aner

Bundled datasets retain their own source attribution and license notices. Example outcomes are not comparative benchmarks or evidence of clinical validity.

Dataset sources & attribution
Install Aner