Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

Implementation of NormalizedReluBounding for non-zero thresholds #100

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

lzampier
Copy link
Member

This new approach can be used when applying the Relu bounding to a threshold value other than the default 0. An obvious use case is the ocean temperature, which should not go below the freezing temperature of the ocean (approx. 271.15 K). The threshold imputed to the function is normalised according to the normalisation scheme specified in the config file.

Here is an example call to be added to the config:

    - _target_: anemoi.models.layers.bounding.NormalizedReluBounding
      variables:
      - avg_tos
      min_val: [271.15] # Needs to be a list 
      normalizer: ["mean-std"]

In case of multiple variables

    - _target_: anemoi.models.layers.bounding.NormalizedReluBounding
      variables:
      - var1
      - var2
      min_val: [val1, val2] # Needs to be a list 
      normalizer: ["norm1", "norm2"]

@FussyDuck
Copy link

FussyDuck commented Dec 16, 2024

CLA assistant check
All committers have signed the CLA.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.85%. Comparing base (0deb66b) to head (c808dcf).
Report is 2 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #100   +/-   ##
========================================
  Coverage    99.85%   99.85%           
========================================
  Files           23       23           
  Lines         1374     1374           
========================================
  Hits          1372     1372           
  Misses           2        2           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@gabrieloks
Copy link
Contributor

Hello! Very cool feature. Have you done any training on this? Are there any specific variables where you would prefer doing this over simply using a std normalization? But I think I can see your point for the freezing temperature of the ocean. With a std normalization, you would not have an absolute zero.

@lzampier
Copy link
Member Author

Yes, this bounding has now been tested for a couple of months. All the results I have shown regarding the surface ocean in the last weeks are run with this feature. The surface temperature is the only obvious test case for now, but when we have a 3D ocean, we will want this for all the vertical layers. I am sure use cases will also pop up for other model components in the future.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants