Skip to content

Conversation

@perctrix
Copy link
Collaborator

@perctrix perctrix commented Dec 9, 2025

See #126.

perctrix and others added 5 commits December 8, 2025 11:49
…ion-metrics

SlidingTrainer: compute validation metrics on reconstructed full volume
…ing-validation

Add PatchTrainingSlidingValidationTrainer for random patch training with sliding window validation
@perctrix perctrix added this to the 1.1.x milestone Dec 9, 2025
@perctrix perctrix self-assigned this Dec 9, 2025
@perctrix perctrix added bug Something isn't working enhancement New feature or request todo New task or assignment labels Dec 9, 2025
@perctrix perctrix requested a review from ATATC December 9, 2025 04:13
@ATATC ATATC changed the title 126 SlidingTrainer.validate_case() should compute metrics on full volume after sliding window reconstruction Dec 9, 2025
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Dec 9, 2025

Deploying mipcandy with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7ad0c44
Status:🚫  Build failed.

View logs

ATATC added 3 commits December 9, 2025 19:21
…Trainer` for consistency and updated references. (#126)
…ges`, refined error message in `SlidingValidationTrainer`. (#126)
@ATATC
Copy link
Contributor

ATATC commented Dec 10, 2025

@perctrix can you double-check my changes? I'll do an overall review later.

@ATATC
Copy link
Contributor

ATATC commented Dec 10, 2025

Lowkey I already noticed the problem. Having a forward() method does not support multiple outputs from the model at all.

@ATATC
Copy link
Contributor

ATATC commented Dec 10, 2025

Remove the forward() interface and merge it back into backward().

@ATATC
Copy link
Contributor

ATATC commented Dec 10, 2025

Remove the forward() interface and merge it back into backward().

@perctrix Can you fix this?

@perctrix
Copy link
Collaborator Author

I'm working on that

@perctrix
Copy link
Collaborator Author

@ATATC I saw your changes and your comment.

A few questions:

  1. What's the motivation for extracting forward() to the base class? The old design (model call inside backward) naturally supported multiple outputs.
  2. Since you already noticed the problem, do you have a solution in mind?

@perctrix
Copy link
Collaborator Author

@ATATC Done. Removed the forward() interface and merged model call back into backward().

@ATATC
Copy link
Contributor

ATATC commented Dec 10, 2025

@ATATC I saw your changes and your comment.

A few questions:

  1. What's the motivation for extracting forward() to the base class? The old design (model call inside backward) naturally supported multiple outputs.
  2. Since you already noticed the problem, do you have a solution in mind?

Cuz (toolbox.ema if toolbox.ema else toolbox.model)(image) doesn't often change and users will tend to forget about this. Separating forward calls and backward calls would make it more modular, but we would need to add types forward() -> torch.Tensor | Sequence[torch.Tensor] which would propagate to all other classes. I was trying to avoid such a massive change, so I suggested just stick with the current backward()-only design.

@ATATC
Copy link
Contributor

ATATC commented Dec 10, 2025

@perctrix I have made some changes to the branch. I removed compute_metrics() and added back the validate_case_windowed() because SlidingTrainer should not assume single outputs for segmentation tasks.

@ATATC ATATC self-requested a review December 10, 2025 19:46
@ATATC ATATC merged commit e15d652 into main Dec 10, 2025
3 checks passed
@ATATC ATATC deleted the 126 branch December 10, 2025 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request todo New task or assignment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SlidingTrainer.validate_case() should compute metrics on full volume after sliding window reconstruction

3 participants