diff --git a/examples/sparse/appnp.py b/examples/sparse/appnp.py index db54cddabca2..7c40e8461f75 100644 --- a/examples/sparse/appnp.py +++ b/examples/sparse/appnp.py @@ -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) @@ -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) diff --git a/examples/sparse/sgc.py b/examples/sparse/sgc.py index 41a397cf581c..c83eb26e3520 100644 --- a/examples/sparse/sgc.py +++ b/examples/sparse/sgc.py @@ -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) @@ -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) diff --git a/examples/sparse/sign.py b/examples/sparse/sign.py index ae7d1b3a9c7a..a272fe6157ba 100644 --- a/examples/sparse/sign.py +++ b/examples/sparse/sign.py @@ -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) @@ -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)