Skip to content

test features#61

Merged
hanaol merged 10 commits intohanaol/dataloader-2from
hanaol/test-feature
Feb 12, 2026
Merged

test features#61
hanaol merged 10 commits intohanaol/dataloader-2from
hanaol/test-feature

Conversation

@hanaol
Copy link
Copy Markdown
Collaborator

@hanaol hanaol commented Jan 16, 2026

Problem

  • The data loader introduced in Hanaol/dataloader 2 #60 does not support saving model predictions or performance metrics.

Solution

  • New utility functions have been added to the Lightning module to handle output saving and performance logging.

Note: The log_dir and out_dir keys in the configuration should be set to specify where performance metrics and model outputs are saved, respectively.

Copy link
Copy Markdown
Collaborator

@forklady42 forklady42 left a comment

Choose a reason for hiding this comment

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

Thanks for tackling this! Having a held out test set will be useful. I've been wondering if we're overfitting, and this will give us a better sense of how we're exhausting our current data.

Comment thread src/electrai/entrypoints/main.py Outdated
Comment thread src/electrai/entrypoints/main.py Outdated
Comment thread src/electrai/entrypoints/test.py Outdated
Comment thread src/electrai/entrypoints/test.py Outdated
Comment thread src/electrai/entrypoints/test.py Outdated
Comment thread src/electrai/lightning.py Outdated
Comment thread src/electrai/entrypoints/test.py Outdated
Comment thread src/electrai/lightning.py Outdated
Comment thread src/electrai/lightning.py Outdated
pred_i = preds[i].numpy()
np.save(out_dir / f"{idx}.npy", pred_i)

self.test_outputs.append(outputs)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Appending all of the outputs could cause this to blow up and OOM. While the test set is small, we can leave this, but noting that we'll probably need to switch to only saving aggregated metrics or writing preds incremently to disk when we have a larger test set.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Would you prefer I make this change now, or wait until we encounter the OOM issue?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is there a reason you want all the preds saved for now? If so, fine to wait until we run into OOMs. If not, let's go ahead and switch to saving only aggregated metrics.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I would like to visualize some of the output density maps to see how they qualitatively look compared to that of labels. In any case, I have now set up save_pred as a configurable parameter in #62 to avoid the potential OOM issue for large test sets.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ok, there seems to be some spill over between these two PRs. I added this comment on 62 because there's additional work we should avoid when not writing preds.

@forklady42 forklady42 mentioned this pull request Jan 23, 2026
Copy link
Copy Markdown
Collaborator Author

@hanaol hanaol left a comment

Choose a reason for hiding this comment

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

I’ve addressed some of the comments.

Copy link
Copy Markdown
Collaborator Author

@hanaol hanaol left a comment

Choose a reason for hiding this comment

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

addressed the comments.

@hanaol hanaol requested a review from forklady42 February 4, 2026 23:11
hanaol and others added 3 commits February 6, 2026 22:58
Handles logging/saving the performance metric across multiple ranks.

---------

Co-authored-by: Hananeh Oliaei <ho0950@della-vis1.princeton.edu>
Co-authored-by: Betsy Cannon <betsy@openathena.ai>
Comment thread src/electrai/dataloader/dataset.py
Copy link
Copy Markdown
Collaborator Author

@hanaol hanaol left a comment

Choose a reason for hiding this comment

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

adressed

@hanaol hanaol merged commit 9b7ead0 into hanaol/dataloader-2 Feb 12, 2026
1 check was pending
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