65 Commits

Author SHA1 Message Date
Dr. Kashif Rasul 0ab82da2cb use glutonts 0.8.0 and remove wandb 2021-07-06 13:16:48 +02:00
Kashif Rasul ea9b2b7df5 Gluon master (#29)
* Estimator needs an create_instance_splitter now

* updated estimators and tests

* fix test

* validated
2021-02-07 17:43:07 +01:00
Dr. Kashif Rasul c7e603be3e fix deepvar test 2021-01-01 13:25:46 +01:00
Dr. Kashif Rasul d5577a2c9e fix some tests 2020-12-30 19:17:54 +01:00
Dr. Kashif Rasul b072ab227b initial gluonts dependency 2020-12-17 17:04:56 +01:00
Dr. Kashif Rasul 149a35a7f8 Revert "add gate_logits to zero inflated"
This reverts commit 7415a15256.
2020-10-21 16:44:44 +02:00
Dr. Kashif Rasul 7415a15256 add gate_logits to zero inflated 2020-10-19 16:04:43 +02:00
Adele Gouttes e3b8de5da9 ASF-3099 Implement IQN in pytorch-ts (#21)
* ASF-3099 Bootstrap: write backbones of test, distribution and distribution output

* ASF-3099 First proposition for IQN distribution output
Mostly for backbones, the functions themselves are far from final

* ASF-3099 Add sample() to ImplicitQuantile and its test

* ASF-3099 Test prediction, sampling and convergence logic for IQN

* ASF-3099 IQN module takes the data input and taus in

* ASF-3099 Add torch.no_grad in the sampling

* ASF-3099 Add tests on quantiles (10%, 90%), for both normal and uniform

* ASF-3099 Improve feeting of quantile function:
Increase depth of quantile network, change activation to PReLU

* ASF-3099 Fix distribution attributes and module imports

* ASF-3099 Fix implicit quantile init

* ASF-3099 Add integration test with deepAR

* ASF-3099 Add a transformed distribution

* ASF-3099 Fix init of ImplicitQuantile

* ASF-3099 Make iqn distribution compatible with forecast-length>1

* ASF-3099 Fix device for new tensors

* ASF-3099 Fix device for new tensors: device is not a function...

* ASF-3099 Fix output size of the network

* ASF-3099 Define torch network in the DistributionOutput only
Distribution takes only the predicted quantiles, or the parameters
of the trained model to define a new quantile function

* ASF-3099 Test: create quantile function on compatible device
Attempt: class method might force the module to be created only once,
not necessarily with the right device

* ASF-3099 Second attempt: create quantile function on compatible device

* ASF-3099 Sampling returns a tensor of the correct shape
Shape is (num_sample, batch_size, forecast_length)

* ASF-3099 Handle empty sample shapes

* ASF-3099 Fix tau device at inference time

* ASF-3099 Fix device of the layer

* ASF-3099 Handle empty sample shapes (fix output)

* ASF-3099 Last activation of quantile layer should be removed
That way, embedded quantiles are symetrically distributed around the 0.5
quantile. Otherwise we distort part of their distribution before applying
it to the forecasted quantities

* ASF-3099 (test) Add a bunch of layers

* ASF-3099 [test] reduce the embedding size of tau

* ASF-3099 [test] Use same IQN version as in sales forecaster

* ASF-3099 Put original parameters back

* use @torch.no_grad() decorator

* ASF-3099 [test, to be reverted] Remove - in front of the loss

* ASF-3099 Revert former commit: put - back in the loss

* ASF-3099 [fix] Add log_prob method in piecewise linear

* ASF-3099 [test] ImplicitQuantileModule should be instanciated only once
Current problem: it's instanciated once at training and once at prediction,
as if the model was never trained. Thus it is now defined as a
global variable. However, this can only be a temporary hack: it means that
only one model can be trained during a session.

* ASF-3099 [test] ImplicitQuantileModule should be instanciated only once
Current problem: it's instanciated once at training and once at prediction,
as if the model was never trained.
However here, if the same model is retrained in the same session,
the module is not reset.

* ASF-3099 Add notebooks for experiments

* ASF-3099 [test] Move module to the distribution

* ASF-3099 Class method for args_proj

* ASF-3099 Clean up

* ASF-3099 More clean up

* ASF-3099 Define options for domain of preditected quantiles
Predicted quantiles can be either positive, either real

* ASF-3099 Set quantile_arg_proj in the init of the distribution output
Before it was instanciated once per python session, thus when retraining
the same models, the previously trained module was used, and not a fresh
one

* ASF-3099 Add test on number of instantiation of the quantile_arg_proj

* ASF-3099 Add an example notebook

* ASF-3099 Remove some notebooks

* ASF-3099 Remove diff vs master

Co-authored-by: Kashif Rasul <kashif.rasul@zalando.de>
Co-authored-by: Mateusz Koren <mateusz.koren@zalando.de>
Co-authored-by: Adele Gouttes <agouttes@bm1-lxslurmctl01.corp.ad.zalando.net>
2020-10-01 15:52:04 +02:00
Kashif Rasul 4aa176186a initial piecewise linear distribution (#22)
* initial piecewise linear distribution

test is failing though

* typo

* added more tests

* added TransformedPiecewiseLinear and output

* added test_robustness and fixed typos

* more typos

* fix issue with torch.where

* sample without grad

* added license
2020-09-17 09:29:19 +02:00
Kashif Rasul 1d341ac515 fix NB test 2020-07-06 13:20:27 +02:00
Dr. Kashif Rasul ac1e89e2cb formatting 2020-06-18 22:14:30 +02:00
Ingmar Schuster 5a06d3406f First go at IndependentDistributionOutput (#16)
* First go at IndependentDistributionOutput, subclassed by NormalOutput and NegativeBinomialOutput for now

* Multivariate test for new implementation of NormalOutput

* adding scaling parameter to NormalOutput

* IndependentNormalOutput now is an alias of NormalOutput with a DeprecatedWarning. Some more univariate distributions now inherit from IndependentDistributionOutput

* IndependentNormalOutput now is an alias of NormalOutput with a DeprecatedWarning. Some more univariate distributions now inherit from IndependentDistributionOutput
2020-06-18 17:08:44 +02:00
Kashif Rasul 859595d555 fixed test 2020-06-18 12:55:51 +02:00
Dr. Kashif Rasul e063a64ccc CustomDateFeatureSet returns summed array from dates 2020-06-16 18:38:53 +02:00
Dr. Kashif Rasul 6efcd6c5b9 upstream fixes to evaluator and NB output 2020-06-03 11:01:32 +02:00
ssmall41 deaee14552 Add imports from holiday.py in unit test module (#14)
Fixes failing unit tests due to missing imports.
2020-05-30 10:39:39 +02:00
Edrin Basha 3b3b064c11 Add CustomHolidayFeatureSet (#13)
* Add CustomHolidayFeatureSet

Add CustomHolidayFeatureSet

* Add tests for CustomHolidayFeatureSet

Add tests for CustomHolidayFeatureSet

* Adding to init py

Adding to init py
2020-05-26 16:06:11 +02:00
Edrin Basha 204efc8bdc Add a new CustomDateFeatureSet class to calculate holiday features ba… (#12)
* Add a new CustomDateFeatureSet class to calculate holiday features based on an array of pandas timestamps

Add a new CustomDateFeatureSet class to calculate holiday features based on an array of pandas timestamps

* Added test case for the CustomDateFeatureSet

Added test case for the CustomDateFeatureSet

* Added new class in the init file

Added new class in the init file
2020-05-22 15:43:13 +02:00
Dr. Kashif Rasul 9d73d9aae8 added headers to tests and fixed readme.
For issue #11
2020-04-30 11:21:57 +02:00
Dr. Kashif Rasul 7e6ed1d87a added lstnet tests 2020-04-27 16:25:48 +02:00
Dr. Kashif Rasul 8a0e59e47c fix for pytorch 1.5 and pydantic 2020-04-21 22:27:05 +02:00
Kashif Rasul c5fac32bb2 initial lstnet multivariate point forecasting model (#9)
* initial lstnet

* lstnet network

* fixed forward

* fix splitter

* fix prediction

* rename argument to what it is i.e. time_first

* fixed scaling and some default values

* scaler can now take time_first=False tensors
2020-04-17 17:13:44 +02:00
Dr. Kashif Rasul cb012405bf optimized the imports 2020-03-30 13:01:08 +02:00
Dr. Kashif Rasul c52dfe9853 mape metric 2020-03-27 11:33:31 +01:00
Dr. Kashif Rasul 37fdb0e5b7 set shuffling of time series in file and list dataset to false by default 2020-03-09 10:51:04 +01:00
Kashif Rasul 5bb0d7d6b6 Dataset (#4)
* Dataset is an iterable of DataEntry

* test_forecast_multivariate

* formatting

* offset can also be W-MON

* fix type

* fourier_time_features_from_frequency_str for weekly data

* randomly shuffle dataset for each worker

* filedataset is not scriptable

* read file randomly

* list and file datasets shuffle the time series in train

* do not shuffle time series in multivariate grouper

* fix tests

* formatting

* formatting
2020-03-05 12:04:09 +01:00
Kashif Rasul da9721ec27 added dataset tests 2020-01-14 20:14:37 +01:00
Dr. Kashif Rasul 7aa6f5ff84 added multivariate normal output tests 2020-01-06 15:22:46 +01:00
Dr. Kashif Rasul 23d9fa33c9 added independent normal test 2020-01-06 15:11:35 +01:00
Dr. Kashif Rasul 98717c2e8f added multivariate gaussian output 2020-01-06 14:49:40 +01:00
Dr. Kashif Rasul dc1951b19e added independent normal output 2020-01-04 20:47:04 +01:00
Dr. Kashif Rasul c1be3fa5a7 typos 2020-01-04 12:41:21 +01:00
Dr. Kashif Rasul f050f80feb added multivariate grouper 2020-01-04 12:22:50 +01:00
Dr. Kashif Rasul 0d2b014f4a fixed tests 2020-01-02 12:51:00 +01:00
Dr. Kashif Rasul ccedec4446 formatting 2020-01-01 23:40:04 +01:00
Dr. Kashif Rasul 0b53c3c941 added LowRankMultivariateNormalOutput 2020-01-01 23:39:08 +01:00
Dr. Kashif Rasul 8cca0b33cb added 2020 holiday test 2019-12-22 13:25:32 +01:00
Dr. Kashif Rasul 29ea3df65e added holiday tests 2019-12-22 13:21:42 +01:00
Dr. Kashif Rasul 16a31f0b53 formatting 2019-12-21 14:59:50 +01:00
Dr. Kashif Rasul 8d0daa3236 added some more tests 2019-12-20 23:23:00 +01:00
Dr. Kashif Rasul 8c3bc77757 instance splitter fix 2019-12-20 12:16:44 +01:00
Dr. Kashif Rasul e7651a510a batch_first 2019-12-19 21:31:34 +01:00
Kashif Rasul d8e9878218 moved transforms to their own module 2019-12-14 10:34:38 +01:00
Dr. Kashif Rasul b5280e6e08 fixed forecast test 2019-12-08 20:11:02 +01:00
Dr. Kashif Rasul c165e00cc3 initial forecast tests 2019-12-08 19:24:55 +01:00
Kashif Rasul 5387acad6d manually set the input_size for now 2019-12-05 21:47:57 +01:00
Kashif Rasul 7905888848 use tuple 2019-12-01 10:05:36 +01:00
Kashif Rasul a01b5be848 fix test 2019-12-01 10:02:35 +01:00
Kashif Rasul e81d244832 get args takes in in_feature argument 2019-11-21 23:13:38 +01:00
Dr. Kashif Rasul eb67bf0b9a added initial artifical const dataset 2019-11-19 16:45:05 +01:00