Skip to content

Poc: base classes for deep models and rnn and deepstate with examples #776

Merged
merged 27 commits into from
Jul 21, 2022

Conversation

martins0n
Copy link
Contributor

@martins0n martins0n commented Jun 30, 2022

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

Closing issues

@github-actions
Copy link

github-actions bot commented Jun 30, 2022

🚀 Deployed on https://deploy-preview-776--etna-docs.netlify.app

@github-actions github-actions bot temporarily deployed to pull request June 30, 2022 22:53 Inactive
@github-actions github-actions bot temporarily deployed to pull request July 1, 2022 08:53 Inactive
@github-actions github-actions bot temporarily deployed to pull request July 1, 2022 12:52 Inactive
@martins0n
Copy link
Contributor Author

@github-actions github-actions bot temporarily deployed to pull request July 1, 2022 14:24 Inactive
@codecov-commenter
Copy link

codecov-commenter commented Jul 1, 2022

Codecov Report

Merging #776 (0ed6428) into master (62737e0) will decrease coverage by 34.16%.
The diff coverage is 37.91%.

@@             Coverage Diff             @@
##           master     #776       +/-   ##
===========================================
- Coverage   83.69%   49.52%   -34.17%     
===========================================
  Files         124      125        +1     
  Lines        6959     7193      +234     
===========================================
- Hits         5824     3562     -2262     
- Misses       1135     3631     +2496     
Impacted Files Coverage Δ
etna/models/nn/rnn.py 31.03% <31.03%> (ø)
etna/models/base.py 60.22% <36.44%> (-27.51%) ⬇️
etna/datasets/tsdataset.py 66.92% <48.00%> (-23.19%) ⬇️
etna/datasets/utils.py 41.66% <57.14%> (-58.34%) ⬇️
etna/pipeline/pipeline.py 83.78% <66.66%> (-13.19%) ⬇️
etna/models/nn/__init__.py 100.00% <100.00%> (ø)
etna/commands/__init__.py 0.00% <0.00%> (-100.00%) ⬇️
etna/commands/backtest_command.py 0.00% <0.00%> (-97.06%) ⬇️
etna/commands/forecast_command.py 0.00% <0.00%> (-94.88%) ⬇️
etna/commands/__main__.py 0.00% <0.00%> (-87.50%) ⬇️
... and 79 more

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@github-actions github-actions bot temporarily deployed to pull request July 3, 2022 19:09 Inactive
@github-actions github-actions bot temporarily deployed to pull request July 3, 2022 19:32 Inactive
etna/models/base.py Outdated Show resolved Hide resolved
pass


class DeepBaseModel(LightningModule, FitAbstractModel, DeepBaseAbstractModel, BaseMixin):
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need inheritance from LightningModule here? I thought that in general composition is better than inheritance.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

general composition is better than inheritance.

I don't think that passing LightningModule as parameter make any difference in our case because we don't have any coupled logic and deep hierarchy. But we will write a little bit extra code for wrappers with duplicated docs.

What downsides do you think of about?

Copy link
Contributor

Choose a reason for hiding this comment

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

Am I correctly understand that you decided to make dependency injection here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll try

etna/datasets/tsdataset.py Outdated Show resolved Hide resolved
etna/datasets/tsdataset.py Outdated Show resolved Hide resolved
etna/datasets/tsdataset.py Outdated Show resolved Hide resolved
etna/datasets/tsdataset.py Outdated Show resolved Hide resolved
etna/datasets/tsdataset.py Outdated Show resolved Hide resolved
etna/models/base.py Outdated Show resolved Hide resolved
etna/models/base.py Outdated Show resolved Hide resolved
etna/models/base.py Outdated Show resolved Hide resolved
etna/models/base.py Outdated Show resolved Hide resolved
etna/models/nn/__init__.py Outdated Show resolved Hide resolved
@alex-hse-repository
Copy link
Collaborator

Notebook seems to be outdated

@github-actions github-actions bot temporarily deployed to pull request July 7, 2022 13:16 Inactive
@github-actions github-actions bot temporarily deployed to pull request July 7, 2022 14:04 Inactive
@github-actions github-actions bot temporarily deployed to pull request July 7, 2022 14:09 Inactive
@github-actions github-actions bot temporarily deployed to pull request July 7, 2022 14:47 Inactive
@alex-hse-repository
Copy link
Collaborator

Improve description in the notebook:

  1. pytorch-lightning -> pytorch-forecasting
  2. We'll used -> We'll use

docs/source/conf.py Outdated Show resolved Hide resolved
etna/datasets/tsdataset.py Outdated Show resolved Hide resolved
etna/datasets/tsdataset.py Outdated Show resolved Hide resolved
etna/models/base.py Outdated Show resolved Hide resolved
etna/models/base.py Outdated Show resolved Hide resolved
etna/models/nn/rnn.py Outdated Show resolved Hide resolved
etna/models/nn/rnn.py Outdated Show resolved Hide resolved
etna/models/nn/rnn.py Outdated Show resolved Hide resolved
etna/models/nn/rnn.py Show resolved Hide resolved
etna/models/nn/rnn.py Outdated Show resolved Hide resolved
@github-actions github-actions bot temporarily deployed to pull request July 11, 2022 15:28 Inactive
@github-actions github-actions bot temporarily deployed to pull request July 11, 2022 17:11 Inactive
@github-actions github-actions bot temporarily deployed to pull request July 11, 2022 17:28 Inactive
@alex-hse-repository
Copy link
Collaborator

I guess we need some more tests:

  1. Test for make_future with tails_steps!=0
  2. Tests for tsdataset_idx_slice
  3. Tests for to_torch_dataset
  4. Tests for DeepBaseModel interface
  5. Test for make_samples in RNN
  6. May be tests for forward/step methods, don't know how to create them without pain

@github-actions github-actions bot temporarily deployed to pull request July 14, 2022 14:00 Inactive
tests/test_datasets/test_dataset.py Outdated Show resolved Hide resolved
tests/test_datasets/test_dataset.py Outdated Show resolved Hide resolved
tests/test_datasets/test_dataset.py Show resolved Hide resolved
tests/test_datasets/test_dataset.py Outdated Show resolved Hide resolved
tests/test_datasets/test_dataset.py Show resolved Hide resolved
tests/test_models/test_base.py Outdated Show resolved Hide resolved
tests/test_models/test_base.py Outdated Show resolved Hide resolved
tests/test_models/test_base.py Outdated Show resolved Hide resolved
tests/test_models/test_base.py Outdated Show resolved Hide resolved
tests/test_models/test_base.py Outdated Show resolved Hide resolved
@github-actions github-actions bot temporarily deployed to pull request July 18, 2022 17:40 Inactive
@github-actions github-actions bot temporarily deployed to pull request July 18, 2022 17:57 Inactive
Copy link
Collaborator

@alex-hse-repository alex-hse-repository left a comment

Choose a reason for hiding this comment

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

Almost done)
There are some unresolved threads left

@github-actions github-actions bot temporarily deployed to pull request July 19, 2022 12:39 Inactive
Copy link
Collaborator

@alex-hse-repository alex-hse-repository left a comment

Choose a reason for hiding this comment

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

👍

Copy link
Collaborator

@alex-hse-repository alex-hse-repository left a comment

Choose a reason for hiding this comment

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

Waiting for some "little" changes)

@github-actions github-actions bot temporarily deployed to pull request July 21, 2022 08:58 Inactive
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.

4 participants