Skip to content

Commit

Permalink
small (dmlc#4954)
Browse files Browse the repository at this point in the history
Co-authored-by: Steve <[email protected]>
  • Loading branch information
frozenbugs and Steve authored Nov 25, 2022
1 parent 815b88a commit 0b9f64d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions examples/sparse/appnp.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def evaluate(g, pred):
return val_acc, test_acc


def train(g, A_hat, X, model):
def train(model, g, A_hat, X):
label = g.ndata["label"]
train_mask = g.ndata["train_mask"]
optimizer = Adam(model.parameters(), lr=1e-2, weight_decay=5e-4)
Expand Down Expand Up @@ -114,4 +114,4 @@ def train(g, A_hat, X, model):
model = APPNP(in_size, out_size).to(dev)

# Kick off training.
train(g, A_hat, X, model)
train(model, g, A_hat, X)
4 changes: 2 additions & 2 deletions examples/sparse/sgc.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def evaluate(g, pred):
return val_acc, test_acc


def train(g, X_sgc, model):
def train(model, g, X_sgc):
label = g.ndata["label"]
train_mask = g.ndata["train_mask"]
optimizer = Adam(model.parameters(), lr=2e-1, weight_decay=5e-6)
Expand Down Expand Up @@ -91,4 +91,4 @@ def train(g, X_sgc, model):
model = nn.Linear(in_size, out_size).to(dev)

# Kick off training.
train(g, X_sgc, model)
train(model, g, X_sgc)
4 changes: 2 additions & 2 deletions examples/sparse/sign.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def evaluate(g, pred):
return val_acc, test_acc


def train(g, X_sign, model):
def train(model, g, X_sign):
label = g.ndata["label"]
train_mask = g.ndata["train_mask"]
optimizer = Adam(model.parameters(), lr=3e-3)
Expand Down Expand Up @@ -124,4 +124,4 @@ def train(g, X_sign, model):
model = SIGN(in_size, out_size, r).to(dev)

# Kick off training.
train(g, X_sign, model)
train(model, g, X_sign)

0 comments on commit 0b9f64d

Please sign in to comment.