Repository navigation
Denoiser examples: L1 or L2 loss and Jacobian penalties, with the papers - #398
Merged
Merged
Conversation
The d07 tutorial and the PnP example script define both losses and use one (L1, as DRUNet), saying which paper uses which: L1 for DRUNet; L2 for DnCNN, FFDNet and the gradient-step denoiser; and why one might choose either (L2 trains towards the MMSE denoiser PnP theory assumes; L1 often trains better, Zhao et al. 2017). No change to what the examples run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6n1VKffUYCm8Gn76j2Uvf
…which loss Pesquet et al. (2021) and Hurault et al. (ICML 2022) both use the L2 loss and add their penalty after training without it; DnCNN, FFDNet, DRUNet and the GS denoiser use none. The commented fine-tuning example now uses l2_loss, as the papers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6n1VKffUYCm8Gn76j2Uvf
The main training passes model_regularization=None explicitly; the fine-tuning example defines both penalties, each with its paper and settings, and picks one, as loss_fn is picked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6n1VKffUYCm8Gn76j2Uvf
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.
The Gaussian-denoiser examples used
torch.nn.L1Loss()without saying why. They now define both losses, use one, and cite the papers:demos/d07_denoisers_and_pnp.py: a cell definingl1_lossandl2_loss,loss_fn = l1_loss, with full references. The commented fine-tuning example usesloss_fntoo.scripts/example_scripts/04_pnp_denoiser.py: the same, shorter.Which paper uses which:
What changes for existing results: nothing; the examples still train with L1.
Second commit: which papers use which
model_regularization. DnCNN, FFDNet, DRUNet and the GS denoiser use none. Pesquet et al. (SIIMS 2021,FirmlyNonexpansivePenalty) and Hurault et al. (ICML 2022,ProximalDenoiserPenalty) both use the L2 loss: they train without the penalty first, then fine-tune with it. The commented fine-tuning example in d07 now usesl2_loss, as those papers do (before, it used the L1 loss of the main example).https://claude.ai/code/session_01L6n1VKffUYCm8Gn76j2Uvf
Generated by Claude Code