Skip to content

Commit

Permalink
Merge branch 'master' into setDaemon
Browse files Browse the repository at this point in the history
  • Loading branch information
drivanov authored Oct 10, 2024
2 parents c3deda6 + 433ffb3 commit 4e131f2
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 11 deletions.
17 changes: 11 additions & 6 deletions examples/pytorch/eeg-gcnn/EEGGraphDataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,22 @@ def get_sensor_distances(self):
def get_geodesic_distance(
self, montage_sensor1_idx, montage_sensor2_idx, coords_1010
):
def get_coord(ref_sensor, coord):
return float(
(coords_1010[coords_1010.label == ref_sensor][coord]).iloc[0]
)

# get the reference sensor in the 10-10 system for the current montage pair in 10-20 system
ref_sensor1 = self.ref_names[montage_sensor1_idx]
ref_sensor2 = self.ref_names[montage_sensor2_idx]

x1 = float(coords_1010[coords_1010.label == ref_sensor1]["x"])
y1 = float(coords_1010[coords_1010.label == ref_sensor1]["y"])
z1 = float(coords_1010[coords_1010.label == ref_sensor1]["z"])
x1 = get_coord(ref_sensor1, "x")
y1 = get_coord(ref_sensor1, "y")
z1 = get_coord(ref_sensor1, "z")

x2 = float(coords_1010[coords_1010.label == ref_sensor2]["x"])
y2 = float(coords_1010[coords_1010.label == ref_sensor2]["y"])
z2 = float(coords_1010[coords_1010.label == ref_sensor2]["z"])
x2 = get_coord(ref_sensor2, "x")
y2 = get_coord(ref_sensor2, "y")
z2 = get_coord(ref_sensor2, "z")

# https://math.stackexchange.com/questions/1304169/distance-between-two-points-on-a-sphere
r = 1 # since coords are on unit sphere
Expand Down
2 changes: 1 addition & 1 deletion examples/pytorch/ogb/directional_GSN/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ def train(dataset, params):

optimizer = optim.Adam(model.parameters(), lr=0.0008, weight_decay=1e-5)
scheduler = optim.lr_scheduler.ReduceLROnPlateau(
optimizer, mode="min", factor=0.8, patience=8, verbose=True
optimizer, mode="min", factor=0.8, patience=8
)

epoch_train_losses, epoch_val_losses = [], []
Expand Down
1 change: 0 additions & 1 deletion examples/pytorch/ogb/ogbn-arxiv/gcn.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ def run(
mode="min",
factor=0.5,
patience=100,
verbose=True,
min_lr=1e-3,
)

Expand Down
1 change: 0 additions & 1 deletion examples/pytorch/ogb/ogbn-products/gat/gat.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,6 @@ def run(
mode="max",
factor=0.7,
patience=20,
verbose=True,
min_lr=1e-4,
)

Expand Down
1 change: 0 additions & 1 deletion examples/pytorch/ogb/ogbn-products/mlp/mlp.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ def run(
mode="max",
factor=0.7,
patience=20,
verbose=True,
min_lr=1e-4,
)

Expand Down
2 changes: 1 addition & 1 deletion examples/pytorch/ogb/ogbn-proteins/gat.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def run(
model.parameters(), lr=args.lr, weight_decay=args.wd
)
lr_scheduler = optim.lr_scheduler.ReduceLROnPlateau(
optimizer, mode="max", factor=0.75, patience=50, verbose=True
optimizer, mode="max", factor=0.75, patience=50
)

total_time = 0
Expand Down

0 comments on commit 4e131f2

Please sign in to comment.