NeuralNet.learn

Train neural network on some data, using specified gradient callback and optimizer.

  1. void learn(D data, S delegate(R net_out, ref T ex, ref V[] grad) grad_f, O opt, bool verbose, uint num_cores)
    class NeuralNet
    void
    learn
    (
    D
    T
    V
    R
    S
    )
    (,
    S delegate
    (,
    ref T ex
    ,
    ref V[] grad
    )
    grad_f
    ,
    O opt
    ,
    bool verbose = false
    ,
    uint num_cores = 1
    )
    if (
    isForwardRange!D &&
    is(ElementType!D == T)
    &&
    (
    is(V == float) ||
    is(V == SparseF)
    )
    &&
    (
    is(R == float[]) ||
    )
    &&
    (
    isNumeric!S ||
    is(S == void)
    )
    )
  2. void learn(D data, string loss, O opt, bool verbose, uint num_cores, bool monitor_loss)
  3. void learn(D data, float delegate(R net_out, ref T ex, ref V[] grad) grad_f, bool verbose, uint num_cores)
  4. void learn(D data, string loss, bool verbose, uint num_cores)

Parameters

data D

forward range of rows

grad_f S delegate
(,
ref T ex
,
ref V[] grad
)

gradient callback (see losses.d for details)

opt O

optimizer to use on all learnable layers for training

verbose bool

whether or not to show progress during training

num_cores uint

degree of Hogwild parallelism

Meta