Skip to content

Data time subsetting#64

Open
SarahAlidoost wants to merge 18 commits into
mainfrom
data_time_subsetting
Open

Data time subsetting#64
SarahAlidoost wants to merge 18 commits into
mainfrom
data_time_subsetting

Conversation

@SarahAlidoost

@SarahAlidoost SarahAlidoost commented Jul 1, 2026

Copy link
Copy Markdown
Member

closes #62
closes #42

🔴 this branch should be merged after #63

In this PR:

  • monthly data are integrated to batch dimension
  • the bias/scale (per-month parameters) are removed to make the model more flexible. We are using residuals training, so the mean seasonal signal is already removed. We are also injecting strong seasonal structure inside the network via cyclic time embedings, temporal attention over days, cross-month mixing in the aggregator.
    So the model is already learning a seasonal climatology and modulation, not relying on a fixed per-month correction.

@meiertgrootes

Copy link
Copy Markdown
Collaborator

See comment in PR #54 on replacing month positional encoding with a month-of-year feature in cyclical time embedding

@SarahAlidoost SarahAlidoost mentioned this pull request Jul 3, 2026
@SarahAlidoost SarahAlidoost marked this pull request as ready for review July 7, 2026 07:00
@SarahAlidoost

SarahAlidoost commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

@meiertgrootes and @rogerkuou Hi, this PR is ready for review. Thanks! After merging #63 , I can update the notebook in this PR.

@rogerkuou rogerkuou mentioned this pull request Jul 7, 2026

@rogerkuou rogerkuou left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hi @SarahAlidoost, thanks for the nice implementation.

I just have two small comments on an inline doc, and use of pytest fixture. Please feel free to merge after fixing them.

Comment thread climanet/dataset.py
time_dim: str = "time",
spatial_dims: Tuple[str, str] = ("lat", "lon"),
patch_size: Tuple[int, int] = (16, 16), # (lat, lon)
patch_size: Tuple[int, int, int] = (1, 16, 16), # (M, lat, lon)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Does "M" mean "month" here? I think it would be nice to have more informative docs about the input dimensions here.

Comment thread tests/test_train.py
Comment on lines +9 to +10
@pytest.fixture
def create_dummy_batch():

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think pytest fixture are supposed to be used as "variables" but not "functions"?

So maybe there you can directly name this fixture dummy_batch

Comment thread tests/test_train.py
and validating model architecture without executing ops.

"""
batch = create_dummy_batch

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

And if you rename the create_dummy_batch to dummy_batch, you do not need to assign this again. Here you are not calling create_dummy_batch() (as a method), so also indicates create_dummy_batch is already a fixture variable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for patching in time in dataset Improve the dataset patching

3 participants