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

Graph Sage OGBN Example with Perforated Backpropagation #9877

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
7 changes: 6 additions & 1 deletion examples/ogbn_train.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
action='store_true',
help='Whether or not to use GAT model',
)
parser.add_argument('-e', '--epochs', type=int, default=10)
parser.add_argument('-e', '--epochs', type=int, default=50)
parser.add_argument('--num_layers', type=int, default=3)
parser.add_argument('--num_heads', type=int, default=2,
help='number of heads for GAT model.')
Expand Down Expand Up @@ -179,6 +179,7 @@ def test(loader: NeighborLoader) -> float:
lr=args.lr,
weight_decay=args.wd,
)
scheduler = torch.optim.lr_scheduler.ReduceLROnPlateau(optimizer, mode='max',patience=5)

print(f'Total time before training begins took '
f'{time.perf_counter() - wall_clock_start:.4f}s')
Expand All @@ -204,6 +205,10 @@ def test(loader: NeighborLoader) -> float:
if val_acc > best_val:
best_val = val_acc
times.append(time.perf_counter() - train_start)
for param_group in optimizer.param_groups:
print('lr:')
print(param_group['lr'])
scheduler.step(val_acc)

print(f'Average Epoch Time on training: '
f'{torch.tensor(train_times).mean():.4f}s')
Expand Down
Loading