Skip to content

Commit 6de4778

Browse files
JPXKQXanaprietonem
andauthored
fix(graphs): unit-range normalisation (#665)
## Description <!-- What issue or task does this change relate to? --> This PR fixes a bug in `anemoi-graphs` when using the following normalisation method: ``` norm: unit-range ``` This is the only method that returns 2 statistics, and it should use the second argument (-1, the range) to scale the attributes. This PR only change the behaviour when `norm: unit-range`, as in the other methods, `statistics[0] = statistics[-1]`. ***As a contributor to the Anemoi framework, please ensure that your changes include unit tests, updates to any affected dependencies and documentation, and have been tested in a parallel setting (i.e., with multiple GPUs). As a reviewer, you are also responsible for verifying these aspects and requesting changes if they are not adequately addressed. For guidelines about those please refer to https://anemoi.readthedocs.io/en/latest/*** By opening this pull request, I affirm that all authors agree to the [Contributor License Agreement.](https://github.com/ecmwf/codex/blob/main/Legal/contributor_license_agreement.md) Co-authored-by: Ana Prieto Nemesio <[email protected]>
1 parent f021017 commit 6de4778

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

graphs/src/anemoi/graphs/normalise.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,4 +125,4 @@ def normalise(self, values: torch.Tensor, *args) -> torch.Tensor:
125125
if self.norm == "unit-range":
126126
values = values - statistics[0]
127127

128-
return values / statistics[0]
128+
return values / statistics[-1]

0 commit comments

Comments
 (0)