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

Make offline ER us total batch size in first update #381

Merged
merged 6 commits into from
Aug 18, 2023

Conversation

lballes
Copy link
Contributor

@lballes lballes commented Aug 17, 2023

Offline ER currently uses only batch_size in the first model update. This PR makes it use batch_size + memory_batch_size to be comparable to joint training, et cetera.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@github-actions
Copy link

github-actions bot commented Aug 17, 2023

Coverage report

The coverage rate went from 85.68% to 85.98% ⬆️

83.33% of new lines are covered.

Diff Coverage details (click to unfold)

src/renate/updaters/experimental/offline_er.py

83.33% of new lines are covered (82.05% of the complete file).
Missing lines: 76

@@ -83,6 +84,21 @@ def train_dataloader(self) -> DataLoader:
pin_memory=True,
collate_fn=self._train_collate_fn,
)
else:
# Manually create a dataloader for the current task with total batch size.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we reuse the code instead of overriding it?

self._batch_size += self._memory_batch_size
loaders["current_task"] = super().train_dataloader()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can do something like that if you prefer it. We would have to undo the change after creating the data loader though.

@lballes lballes marked this pull request as ready for review August 17, 2023 12:42
@lballes lballes requested a review from wistuba August 17, 2023 12:43
@wistuba wistuba merged commit 2ca8df2 into dev Aug 18, 2023
18 checks passed
@wistuba wistuba deleted the lballes-er-batch-size branch August 18, 2023 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants