autodiff

autodiff, keyword, block

The autodiff keyword introduces a block intended for a stochastic gradient descent. The logic within the autodiff block is automatically differentiated. The keyword is followed by the name of the observation table.

autodiff Scalar epochs: 500 learningRate: 0.1 with
  params a auto
  s = a * a
  return s

show scalar "" with a // 0.00

The option epochs is optional; its default value is 10.

The option learningRate is optional; its default value is 0.01.

The parallel mode

The execution of the autodiff block can be automatically parallelized. This execution mode is intended for larger datasets. This parallelization typically incurs a modest decrease of convergence speed - counted in epochs - in exchange for a faster wall-clock execution.

autodiff Scalar epochs: 500 learningRate: 0.1 mode: "parallel" with
  params a auto
  s = a * a
  return s

show scalar "" with a // 0.00

In the script above, the mode option is set to parallel.

autodiff, keyword, pure function option

The autodiff keyword indicates that the pure function can be executed inside an autodiff block

def autodiff pure mySquare(x: number) with 
  return x * x

autodiff Scalar epochs: 500 with
  params a auto
  return mySquare(a)

show scalar "" with a // 0.00

In the present reference documentation, pure functions that are part of the Envision standard library and that can be executed inside an autodiff block are marked as autodiff.