Options
All
  • Public
  • Public/Protected
  • All
Menu

Linear layer calculates y=xW + b

W is initialized with Xavier initialization, while the bias is initialized to zeros

Hierarchy

Index

Constructors

constructor

  • new Linear(dimIn: number, dimOut: number, bias?: boolean): Linear
  • Creates a linear layer

    Parameters

    • dimIn: number

      Feature dimension of the input

    • dimOut: number

      Feature dimension of the output

    • Optional bias: boolean

      Wether a bias should be added or not. Defaults to true

    Returns Linear

Properties

backend

backend: Backend = 'CPU'

Optional bias

bias: undefined | Tensor<any>

mode

mode: Mode = 'train'

weights

weights: Tensor<any>

Methods

forward

getParameters

getSubModules

toBackend

  • toBackend(backend: Backend): Promise<void>

toCPU

  • toCPU(): Promise<void>

toGPU

  • toGPU(): Promise<void>

toWASM

  • toWASM(): Promise<void>

Generated using TypeDoc