Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Right now,
BalancedBatchSampler
has some rough edges:npz
format for the metadata storage which needs to be followed for any dataset that wants to be balanced. Currently, the new ASE dataset doesn't support this format.force_balancing
andthrow_on_error
parameters are confusing.For this PR, I updated
BalancedBatchSampler
to rely on a protocol which expects datasets to implement adata_sizes
method, which returns the "size" of each dataset sample. I have updatedLmdbDataset
andOC22LmdbDataset
to implement this in a backward-compatible manner w/ the old implementation.I have also completely removed the neighbors balancing support, as our graph generation happens on GPU anyway, and the number of neighbors changes depending on
max_neighbors
/cutoff
. In many cases, the values stored in the metadata would end up not being accurate.As a TL;DR, here's essentially the main change (as far as the datasets are concerned).
Previously:
Now:
Tasks:
BalancedBatchSampler
to use datasets'data_sizes
methodBalancedBatchSampler
'sforce_balancing
andthrow_on_error
parameters withon_error