Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
rpautrat authored Feb 9, 2024
2 parents 0d93e4c + 365ad7b commit 201905b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions gluefactory/datasets/base_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,12 @@ def get_data_loader(self, split, shuffle=None, pinned=False, distributed=False):
except omegaconf.MissingMandatoryValue:
batch_size = self.conf.batch_size
num_workers = self.conf.get("num_workers", batch_size)
drop_last = True if split == "train" else False
if distributed:
shuffle = False
sampler = torch.utils.data.distributed.DistributedSampler(dataset)
sampler = torch.utils.data.distributed.DistributedSampler(
dataset, drop_last=drop_last
)
else:
sampler = None
if shuffle is None:
Expand All @@ -178,7 +181,7 @@ def get_data_loader(self, split, shuffle=None, pinned=False, distributed=False):
num_workers=num_workers,
worker_init_fn=worker_init_fn,
prefetch_factor=self.conf.prefetch_factor,
drop_last=True if split == "train" else False,
drop_last=drop_last,
)

def get_overfit_loader(self, split):
Expand Down
2 changes: 1 addition & 1 deletion gluefactory/models/utils/losses.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,5 @@ def nll_loss(self, log_assignment, data):
weights[:, :m, :n] = positive

weights[:, :m, -1] = neg0
weights[:, -1, :m] = neg1
weights[:, -1, :n] = neg1
return weights

0 comments on commit 201905b

Please sign in to comment.