Linear

class dragon.vm.torch.nn.Linear(
  in_features,
  out_features,
  bias=True
)[source]

Apply the linear transformation.

\[y = Wx + b \]

Examples:

m = torch.nn.Linear(2, 3)
x = torch.ones(2, 2)
y = m(x)

__init__

Linear.__init__(
  in_features,
  out_features,
  bias=True
)[source]

Create a Linear module.

Parameters:
  • in_features (int) – The number of input features.
  • out_features (int) – The number of output features.
  • bias (bool, optional, default=True) – True to add a bias on the output.