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

AreaWeights filling #44

Open
JPXKQX opened this issue Nov 22, 2024 · 0 comments
Open

AreaWeights filling #44

JPXKQX opened this issue Nov 22, 2024 · 0 comments
Assignees
Labels
bug Something isn't working graphs

Comments

@JPXKQX
Copy link
Member

JPXKQX commented Nov 22, 2024

What happened?

The current behaviour to compute the area weights of a set of nodes is explained below step by step:

  • The globe is split into polygons, where each polygon should correspond to one and only one node.
  • Each node is linked to a polygon, also referred to as a region. These regions are defined with a list[int] where each index corresponds to a node/vertex.
  • The issue pre-commits-for-models-graphs-dev #45 was happening when a node was associated with no region, an empty list ([]), whose dtype was np.int64, and it was raising this "dtype mismatch" error.
  • The current implementation of AreaWeights solves this issue by filling these values with 0 (or any variable defined in the fill_value attribute). This default behaviour can be dangerous as it seems some cases there may be many of these nodes, and their contribution to the loss function would be 0.

example

Some options to address/alleviate this problem are:

  • Log a warning when the filling is done.
  • Support filling with the min or mean.
  • Set "np.nan" as the default value and handle it later (in anemoi-training?, in a post-processor?, ...)

Version

develop

Platform (OS and architecture)

x86_64 GNU/Linux

@JPXKQX JPXKQX added the bug Something isn't working label Nov 22, 2024
@JPXKQX JPXKQX self-assigned this Nov 22, 2024
@JesperDramsch JesperDramsch transferred this issue from ecmwf/anemoi-graphs Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working graphs
Projects
None yet
Development

No branches or pull requests

2 participants