Skip to content

Fix bug in new NNs with forecasting interval #1108

Merged
merged 9 commits into from Feb 28, 2023
Merged

Conversation

Mr-Geekman
Copy link
Contributor

@Mr-Geekman Mr-Geekman commented Feb 10, 2023

Before submitting (must do checklist)

  • Did you read the contribution guide?
  • Did you update the docs? We use Numpy format for all the methods and classes.
  • Did you write any new necessary tests?
  • Did you update the CHANGELOG?

Proposed Changes

Change alignment during forecasting.

Closing issues

Closes #1087.

@Mr-Geekman Mr-Geekman self-assigned this Feb 10, 2023
@github-actions
Copy link

github-actions bot commented Feb 10, 2023

@github-actions github-actions bot temporarily deployed to pull request February 10, 2023 08:38 Inactive
@codecov-commenter
Copy link

codecov-commenter commented Feb 10, 2023

Codecov Report

❗ No coverage uploaded for pull request base (inference-v2.1@72c7e79). Click here to learn what that means.
The diff coverage is n/a.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@                Coverage Diff                @@
##             inference-v2.1    #1108   +/-   ##
=================================================
  Coverage                  ?   86.86%           
=================================================
  Files                     ?      164           
  Lines                     ?     8954           
  Branches                  ?        0           
=================================================
  Hits                      ?     7778           
  Misses                    ?     1176           
  Partials                  ?        0           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@martins0n martins0n self-requested a review February 13, 2023 07:36
Copy link
Contributor

@martins0n martins0n left a comment

Choose a reason for hiding this comment

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

It's seems like nothing change on the level of test cases, isn't it?

),
],
)
def test_forecast_in_sample_full_no_target_failed_assertion_error(self, model, transforms, example_tsds):
Copy link
Contributor

Choose a reason for hiding this comment

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

I've seen this pattern while refactoring nn for etna-v2

Why do we duplicate information about assertion raised?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can you explain please what exactly do you mean? Naming of the test?

Copy link
Contributor

@martins0n martins0n Feb 14, 2023

Choose a reason for hiding this comment

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

@to_be_fixed(raises=AssertionError) and test_forecast_in_sample_full_no_target_failed_assertion_error

  • assertion_error duplication
  • Instead of using test_forecast_in_sample_full_no_target with pytest.mark.xfail

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  • assertion_error to distinguish different tests that failed in different ways.
  • to_be_fixed is used to clarify that we want to fix that test in the future and I can write a particular error message to catch inside the test.

@Mr-Geekman
Copy link
Contributor Author

Please, take a look at the #1087, I explained what I've found about these tests and probable solutions. But I think all of them aren't really good and should be discussed.

@github-actions github-actions bot temporarily deployed to pull request February 21, 2023 18:04 Inactive
@@ -93,6 +99,7 @@ def step(self, batch: MLPBatch, *args, **kwargs): # type: ignore
:
loss, true_target, prediction_target
"""
self._validate_batch(batch)
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems we validate twice.

We can call forward pass in step

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As I understand, step isn't called during forecasting, it is called only during training.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We use step in training_step and validation_step, it is for training.

@Mr-Geekman Mr-Geekman merged commit 20c8bd1 into inference-v2.1 Feb 28, 2023
@Mr-Geekman Mr-Geekman deleted the issue-1087 branch February 28, 2023 08:34
This was referenced Mar 21, 2023
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.

None yet

3 participants