Skip to main content

Module builder

Module builder 

Source
Expand description

Model builder.

MlpBuilder is the recommended way to define a model.

It makes model structure explicit (layer sizes + activations) and chooses a reasonable default weight initializer for each activation:

  • tanh / sigmoid / identity: Xavier/Glorot
  • relu / leaky relu: He/Kaiming

The resulting Mlp still supports the low-level, allocation-free hot path: reuse Scratch / Gradients for per-sample forward/backward.

Structsยง

MlpBuilder
Builder for an Mlp.