NVIDIA / modulus

Open-source deep-learning framework for building, training, and fine-tuning deep learning models using state-of-the-art Physics-ML methods
https://developer.nvidia.com/modulus
Apache License 2.0
903 stars 208 forks source link

Fix corr-diff conditional scaling #381

Closed nbren12 closed 6 months ago

nbren12 commented 6 months ago

Modulus Pull Request

Description

This PR fixes the scaling for conditional inputs in corrdiff. Previously the conditional inputs were concatenated with the noisy target BEFORE scaling. This means that for large noise the conditional inputs will also be scaled down to near 0. This is undesirable since the large-noise limits corresponds to deterministic prediction---we expect the conditional inputs to matter most in this case! This PR fixes this by scaling the noise image BEFORE concatenating it with the conditioning.

I wrote this PR with unit testing in mind, so I wrote a modular class _ConditionalPrecond which is testable in isolation. I added a public API EDMPrecondSRV2 to provide a similar interface as EDMPrecondSR that also builds the UNet.

Closes #229.

Checklist

Dependencies

nbren12 commented 6 months ago

BTW, I've used this code preconditioner in some other projects with good results.

MortezaMardani commented 6 months ago

makes sense to me.

yairchn commented 6 months ago

/blossom-ci

nbren12 commented 6 months ago

/blossom-ci

ktangsali commented 6 months ago

/blossom-ci

ktangsali commented 6 months ago

/blossom-ci