TimeEncoder
¶
TimeEncoder(out_features_dim: int)
Bases: Module
The time encoder of TGN, \(\cos(\mathbf{w} t + \mathbf{b})\).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
out_features_dim
|
int
|
Size of the encoding |
required |
Example:
from mlx_graphs.nn.models.tgn import TimeEncoder
enc = TimeEncoder(8)
enc(mx.array([0.0, 10.0, 100.0])).shape
>>> (3, 8)
Methods:
| Name | Description |
|---|---|
reset_parameters |
Re-initializes the linear layer. |
Attributes:
| Name | Type | Description |
|---|---|---|
out_channels |
int
|
PyG name of |
Source code in mlx_graphs/nn/models/tgn.py
from mlx_graphs.nn.models.tgn import TimeEncoder · mlx_graphs/nn/models/tgn.py