FUNCTION REFERENCE

train

Train a shallow supervised neural network.

Train a shallow supervised neural network.

Syntax

[net,tr] = train(net,x,t[,xi,ai,ew][,Name,Value])

net.trainFcn selects the training function: trainlm, trainscg, trainbr, traingd, traingdm, traingdx, trainrp or trainbfg. trainlm and trainbr require squared-error performance ('mse' or 'sse').

Static cell sequences are concatenated by sample. Xi and Ai must be empty.

EW accepts a nonnegative scalar, sample row, output column or target-sized matrix.

useParallel, useGPU and showResources are accepted execution hints and ignored.

showWindow is ignored; showCommandLine prints every trainParam.show epochs.

The record contains epoch 0, performance, validation/test performance, gradient,

validation failures, algorithm states and the stopping reason. With validation

active the returned network uses the best validation weights. Empty validation/test

divisions have empty vperf/tperf series and NaN best_vperf/best_tperf.

Example

rng(1); n=fitnet(3); n.divideFcn='dividetrain'; n.trainParam.epochs=5; [n,tr]=train(n,[-1 0 1],[1 0 1]);

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.