Linear
simplegrad.nn.linear.Linear
Bases: Module
Fully-connected linear layer: output = x @ W + b.
Weights are initialized with Kaiming uniform (range [-1/sqrt(in), 1/sqrt(in)]).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
in_features
|
int | None
|
Number of input features. |
None
|
out_features
|
int | None
|
Number of output features. |
None
|
weight
|
Tensor | None
|
Optional pre-built weight tensor of shape |
None
|
bias
|
Tensor | None
|
Optional pre-built bias tensor of shape |
None
|
use_bias
|
bool
|
Add a bias term. Defaults to True. |
True
|
dtype
|
str
|
Data type string. Defaults to |
None
|
weight_label
|
str
|
Label for the weight tensor (used in graph visualization). |
'W'
|
bias_label
|
str
|
Label for the bias tensor. |
'b'
|