Linear
¶
Bases: Linear
Linear layer with Xavier Glorot weight initialization and a zero bias.
This Linear class inherits from mx.nn.Linear, but uses glorot
initialization instead of the default initialization in mlx's Linear,
like PyG's Linear(weight_initializer="glorot") used by e.g. GCN and
GAT. Layers that PyG initializes like torch.nn.Linear (e.g.
GraphSAGE) use mlx.nn.Linear, which has the same default
initialization as PyTorch.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_dims
|
int
|
Dimensionality of the input features |
required |
output_dims
|
int
|
Dimensionality of the output features |
required |
bias
|
bool
|
If set to |
True
|
Source code in mlx_graphs/nn/linear.py
from mlx_graphs.nn import Linear · mlx_graphs/nn/linear.py