Include WGAN-GP Model and Losses#23
Open
MattsonCam wants to merge 8 commits into
Open
Conversation
added 8 commits
May 29, 2026 10:48
Add a comprehensive documentation pass for the WGAN-GP global critic module to clarify intent, architecture, and usage semantics. - add module-level docstring describing critic role and output semantics - add class docstring with architecture overview and argument details - add __init__ docstring for constructor purpose - add forward docstring with expected input shape and output interpretation - clarify that outputs are unconstrained critic scores (no sigmoid)
- remove inplace LeakyReLU activations for safer autograd behavior - make capacity configurable via num_blocks and optional max_channels cap - build feature blocks programmatically from base_channels scaling - update classifier input width to follow final computed channel size - return vector critic scores with shape (batch,) via squeeze(-1)
Expand loss docstrings to match the structured documentation pattern used in metrics (Args/Returns/Raises) for consistency and readability. - add __init__ argument docs to Wasserstein losses - expand forward() docs with input expectations and behavior - document returned scalar formulas for Wasserstein objectives - document shape/batch-size validation errors - apply same structured style to L1Loss forward() docstring
wli51
approved these changes
May 29, 2026
wli51
left a comment
There was a problem hiding this comment.
LGTM! Left one clarification question/nitpick
|
|
||
| def forward( | ||
| self, | ||
| gradients: torch.Tensor, |
There was a problem hiding this comment.
Just to double check if your intention here is to have the interpolation step in training orchestration, outside of loss module.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pr includes the WGAN-GP global discriminator model and the generator and discriminator losses.