← Back to Pull requests

Generating physically-consistent high-resolution climate data with hard-constrained neural networks #137

Closed
unknown closed this pull request without merging on Feb 24, 2025 07:23 UTC
View on GitHub
unknown unknown commented on Feb 11, 2025 18:55 UTC
Author

Pull Request for #52

Description

This PR introduces functionality for generating physically-consistent, high-resolution climate data using hard-constrained neural networks. The primary addition is the implementation of hard constraints, ensuring that generated climate data adheres to fundamental physical laws. This constraint mechanism is modular and can be applied to any model within this repository or following the same format.

Motivation and Context


Accurate climate modeling demands that generated data respect physical laws (e.g., conservation of mass, energy). By adding hard constraints, models in this repository will produce outputs that are both high-resolution and physically plausible, improving their utility for climate science applications.

This implementation follows the methodology outlined in the paper:
Generating Physically-Consistent High-Resolution Climate Data with Hard-Constrained Neural Networks.
The approach is inspired by and adapted from the RolnickLab's constrained-downscaling source code.

Fixes #52

How Has This Been Tested?

I have written unit tests to verify the correct implementation of the hard-constrained neural network logic. These tests focus on:

Constraint Enforcement
Model Compatibility

  • Yes
  • _If your changes affect data processing, have you plotted any changes? i.e. have you done a quick sanity check?_

  • Yes
  • Checklist:

  • My code follows OCF's coding style guidelines

  • I have performed a self-review of my own code

  • I have made corresponding changes to the documentation

  • I have added tests that prove my fix is effective or that my feature works

  • I have checked my code and corrected any misspellings
  • To be reviewed: @jacobbieker

    Diff: 243 lines (+182 / -61) across 3 files Reviewer: aniket2405 Review duration: 18027m
    All Vouch review confidence checks passed
    Residual risk 0.15 = Change Risk (0.39) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.39 · 243 lines diff across 3 files
    0.39
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.329
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #137"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 38.8% (MEDIUM) · Higher = larger blast radius
    38.8%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 15.3% · Safe to merge
    15.3%