Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

activation functions added for bounded outputs #14

Merged
merged 35 commits into from
Sep 23, 2024

Conversation

gabrieloks
Copy link
Contributor

@gabrieloks gabrieloks commented Aug 1, 2024

This PR is related to the open issue #13 and the aifs-mono PR https://github.com/ecmwf-lab/aifs-mono/pull/224.

The basic idea behind this PR is to implement bounding strategies for specific variables, chosen by the user, via the usage of activation functions. One evident example the total precipitation accumulation variable, which is not currently bounded, therefore prone to negative value predictions.

Closes #13

@gabrieloks gabrieloks added the enhancement New feature or request label Aug 1, 2024
@FussyDuck
Copy link

FussyDuck commented Aug 1, 2024

CLA assistant check
All committers have signed the CLA.

@codecov-commenter
Copy link

codecov-commenter commented Aug 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.84%. Comparing base (0219266) to head (5180c8a).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop      #14   +/-   ##
========================================
  Coverage    99.83%   99.84%           
========================================
  Files           22       23    +1     
  Lines         1216     1277   +61     
========================================
+ Hits          1214     1275   +61     
  Misses           2        2           

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

@mchantry
Copy link
Member

Great work on this, thanks.

@mchantry mchantry added the ATS approved Approved by ATS label Sep 17, 2024
mchantry
mchantry previously approved these changes Sep 23, 2024
Copy link
Member

@mchantry mchantry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, approved. Please merge.

@JesperDramsch JesperDramsch merged commit 90ef59c into develop Sep 23, 2024
106 checks passed
@JesperDramsch JesperDramsch deleted the feature/activation_function branch September 23, 2024 12:55
theissenhelen pushed a commit that referenced this pull request Sep 27, 2024
* activation functions added for bounded outputs

* generalised fraction normalisation

* precommit changes

* precommit changes

* chore: mv bounding to post-processors

* feat: make bounding strategies torch Module

* refactor: pre-build indices during init

* refactor: nn.module in place modification

* refactor: mv bounding to layers

* refactor: implement bounding ModuleList

* docs: add changelog

* refactor: mv bounding config to models

* feat: enable 1-1 variable remapping in preprocessors

* test: create tests and fix code

* test: add a test for hydra instantiating of bounding

* fix: naming

* refactor: reduce verboseness

* docs: add comments

* fix: inject name_to_index on initiation

* fixed reading of statistics remapping

* revert

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update test_preprocessor_normalizer.py

* Update encoder_processor_decoder.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* docs: added a comment on special keys

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* docs: add docstrings

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix: changelog

---------

Co-authored-by: Jesper Dramsch <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ATS approved Approved by ATS enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Activation functions for bounding the output of the model
5 participants