Skip to content

Include WGAN-GP Model and Losses#23

Open
MattsonCam wants to merge 8 commits into
mainfrom
include_wgan_gp
Open

Include WGAN-GP Model and Losses#23
MattsonCam wants to merge 8 commits into
mainfrom
include_wgan_gp

Conversation

@MattsonCam
Copy link
Copy Markdown
Member

This pr includes the WGAN-GP global discriminator model and the generator and discriminator losses.

Cameron Mattson 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
Copy link
Copy Markdown

@wli51 wli51 left a comment

Choose a reason for hiding this comment

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

LGTM! Left one clarification question/nitpick


def forward(
self,
gradients: torch.Tensor,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Just to double check if your intention here is to have the interpolation step in training orchestration, outside of loss module.

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