DenseGINConv
¶
Bases: Module
Dense version of GINConv.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mlp
|
Module
|
The neural network applied to the aggregated features. |
required |
eps
|
float
|
Initial value of \(\epsilon\). Default: |
0.0
|
learn_eps
|
bool
|
Whether \(\epsilon\) is a trainable parameter (PyG's
|
False
|
Example:
import mlx.core as mx
import mlx.nn as nn
from mlx_graphs.nn import DenseGINConv
conv = DenseGINConv(nn.Sequential(nn.Linear(16, 32), nn.ReLU()))
adj = (mx.random.uniform(shape=(2, 10, 10)) > 0.7).astype(mx.float32)
node_features = mx.random.normal((2, 10, 16))
>>> conv(adj, node_features).shape
(2, 10, 32)
Methods:
| Name | Description |
|---|---|
__call__ |
Computes the node embeddings. |
Source code in mlx_graphs/nn/conv/dense_conv.py
__call__
¶
__call__(
adj: array,
node_features: array,
mask: Optional[array] = None,
add_loop: bool = True,
) -> array
Computes the node embeddings.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
adj
|
array
|
Adjacency matrices of shape |
required |
node_features
|
array
|
Node features of shape |
required |
mask
|
Optional[array]
|
Optional boolean mask of shape |
None
|
add_loop
|
bool
|
Whether to add the \((1 + \epsilon)\)-weighted
features of each node. Default: |
True
|
Returns:
| Type | Description |
|---|---|
array
|
The node embeddings, of shape |
Source code in mlx_graphs/nn/conv/dense_conv.py
from mlx_graphs.nn import DenseGINConv · mlx_graphs/nn/conv/dense_conv.py