-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
916 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import lightning.pytorch as pl | ||
from torch_geometric.loader.dataloader import DataLoader | ||
|
||
from gwnet.datasets import METRLA | ||
from gwnet.model import GraphWavenet | ||
from gwnet.train import GWnetForecasting | ||
|
||
|
||
def train(): | ||
args = {"lr": 0.01, "weight_decay": 0.0001} | ||
|
||
model = GraphWavenet(adaptive_embedding_dim=64, n_nodes=207, k_diffusion_hops=1) | ||
plmodule = GWnetForecasting(args, model, missing_value=0.0) | ||
|
||
trainer = pl.Trainer( | ||
accelerator="mps", | ||
max_steps=100, | ||
gradient_clip_val=5.0, # TODO There was something about this in the code. | ||
) | ||
|
||
dataset = METRLA("./") | ||
## TODO Parametrise. | ||
loader = DataLoader(dataset, batch_size=1, num_workers=0) | ||
|
||
trainer.fit(model=plmodule, train_dataloaders=loader) | ||
|
||
|
||
if __name__ == "__main__": | ||
train() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from .gwnet import GraphWavenet | ||
|
||
__all__ = ["GraphWavenet"] |
Oops, something went wrong.