Add diffusion based noise model#35
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@copilot investigate why the tests are failing |
Agent-Logs-Url: https://github.com/synthesizer-project/synference/sessions/7874d3da-9020-4367-8fb5-9f51fe2180df Co-authored-by: tHarvey303 <8613717+tHarvey303@users.noreply.github.com>
Agent-Logs-Url: https://github.com/synthesizer-project/synference/sessions/7874d3da-9020-4367-8fb5-9f51fe2180df Co-authored-by: tHarvey303 <8613717+tHarvey303@users.noreply.github.com>
The failures were caused by a When noise models are used, Fixed in f6e0bf6 by extracting the scalar from the returned arrays with scattered_fluxes[i] = scattered_flux[0]
errors[i] = sigma[0] |
|
@copilot There is still an issue relating to the coverage testings in the ltu-ili package. What is causing this? |
…r-project/synference into diffusion_noise_model
…inh magnitudes is probably a better strategy.)
This PR introduces a new generative machine learning model (ScoreBasedUncertaintyModel) to realistically simulate photometric measurement errors.
When generating mock galaxy catalogs, applying simple, uncorrelated Gaussian noise to true fluxes fails to capture the complex, real-world noise properties of surveys like COSMOS2020. Measurement errors are highly correlated across filters (e.g., due to blending or extraction methods) and exhibit heavy-tailed distributions.
This model uses a continuous-time diffusion framework (Variance Preserving SDE) to learn the full joint probability distribution of flux uncertainties across all bands in a survey, conditioned on the source's true magnitudes. This allows us to sample highly realistic, correlated noise for synthetic data.
Core Implementation
Neural Network Architecture
The underlying score estimator (
_RobustScoreNetwork) is designed specifically for stability and capturing high-frequency schedule details:Here's an example showing the true log-flux error vs magnitude density for the COSMOS2020 catalog (dashed are 68% of points, solid are 95% of points) in blue, and the recovered distribution from the trained model is shown in red. The conditional relationships between flux uncertainty in different filters is learned by the network, even in the complex distribution case of the HSC filters due to the striping of the survey depths.
To Do