Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make gnn_node.py constitent with gnn_link.py #260

Merged
merged 1 commit into from
Aug 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions examples/gnn_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def test(loader: NeighborLoader) -> np.ndarray:
model.eval()

pred_list = []
for batch in loader:
for batch in tqdm(loader):
batch = batch.to(device)
pred = model(
batch,
Expand Down Expand Up @@ -195,8 +195,8 @@ def test(loader: NeighborLoader) -> np.ndarray:
val_metrics = task.evaluate(val_pred, task.get_table("val"))
print(f"Epoch: {epoch:02d}, Train loss: {train_loss}, Val metrics: {val_metrics}")

if (higher_is_better and val_metrics[tune_metric] > best_val_metric) or (
not higher_is_better and val_metrics[tune_metric] < best_val_metric
if (higher_is_better and val_metrics[tune_metric] >= best_val_metric) or (
not higher_is_better and val_metrics[tune_metric] <= best_val_metric
):
best_val_metric = val_metrics[tune_metric]
state_dict = copy.deepcopy(model.state_dict())
Expand Down
Loading