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

Float64 conversion #83

Merged
merged 9 commits into from
Apr 26, 2024
Merged

Float64 conversion #83

merged 9 commits into from
Apr 26, 2024

Conversation

FNTwin
Copy link
Collaborator

@FNTwin FNTwin commented Apr 23, 2024

Conversion to float64 for Potential Dataset

from torch_geometric.data import Data
from torch_geometric.loader import DataLoader

return DataLoader(
Copy link
Collaborator

@shenoynikhil shenoynikhil Apr 26, 2024

Choose a reason for hiding this comment

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

Add support for num_workers, pin_memory and additional data loader arguments that can be passed (similar to how pyg dataloader does it.

@@ -546,6 +546,48 @@ def wrapper(idx):
datum["idxs"] = idxs
return datum

@classmethod
Copy link
Collaborator

@shenoynikhil shenoynikhil Apr 26, 2024

Choose a reason for hiding this comment

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

Why class method? Why not a normal method and remove the additional arguments. Also, say I split my dataset in train and val dataset, after which I want to create dataloaders? Will this work?

Can we address this in a different PR?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also, we should test this if we are adding this feature.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ops, it was not supposed to be inside the PR. It was one of my custom piece of code that i use for utilities

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed

return {
"atomic_inputs": np.float32,
"position_idx_range": np.int32,
"energies": np.float32,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't it be np.float64?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Interaction energies don't use total energies so the energy values is fine at float32

return {
"atomic_inputs": np.float32,
"position_idx_range": np.int32,
"energies": np.float32,
Copy link
Collaborator

@shenoynikhil shenoynikhil Apr 26, 2024

Choose a reason for hiding this comment

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

As this is a potential dataset, shouldn't we do float64.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This dataset is used for static testing and we should regenerate the data to be float64 in case. As the accuracy is not actually a real issue here I find that just overriding the energy type is good enough

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yup, can we regenerate to follow the same format.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Regerated to float64

@FNTwin FNTwin merged commit 0c3f54a into release Apr 26, 2024
5 checks passed
@FNTwin FNTwin deleted the float64 branch April 26, 2024 19:27
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.

2 participants