feat: WSL meta arch#16
Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 36 minutes and 18 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (6)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a new weakly supervised learning (WSL) meta-architecture designed for analyzing nuclei graphs. It provides the core implementation for training, validating, and testing this model using PyTorch Lightning, along with specific configuration files to facilitate its application to different prostate cancer datasets. This enhancement enables the system to leverage weakly supervised signals for improved nuclei-level analysis. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces the NucleiWSLMetaArch PyTorch Lightning module and associated Hydra configurations for nucleus-level weakly supervised learning on prostate cancer datasets. The implementation includes training and evaluation logic, metric logging, and an optimizer setup with a linear warmup and cosine annealing scheduler. Feedback focuses on ensuring training/inference consistency by applying block masking during training and improving reproducibility by registering the best validation loss as a persistent buffer for checkpointing.
| self.val_metrics = MetricCollection(metrics, prefix="validation/") | ||
| self.test_metrics = MetricCollection(metrics, prefix="test/") | ||
|
|
||
| self.best_val_loss = float("inf") |
There was a problem hiding this comment.
To ensure reproducibility and correct behavior when resuming training from a checkpoint, best_val_loss should be registered as a buffer. This ensures its value is persisted in the model's state dict and not reset to infinity upon restart.
| self.best_val_loss = float("inf") | |
| self.register_buffer("best_val_loss", torch.tensor(float("inf"))) |
References
- Reproducibility is paramount. Ensure state that affects training logic is persisted. (link)
| self.val_step_sizes.clear() | ||
|
|
||
| if val_loss < self.best_val_loss: | ||
| self.best_val_loss = val_loss |
No description provided.