27 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 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
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 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
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 8a0e59e47c fix for pytorch 1.5 and pydantic 2020-04-21 22:27:05 +02:00
Dr. Kashif Rasul cb012405bf optimized the imports 2020-03-30 13:01:08 +02: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 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 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
Kashif Rasul e81d244832 get args takes in in_feature argument 2019-11-21 23:13:38 +01:00
Kashif Rasul aa9aa2ed81 added inital scaler 2019-11-17 11:03:26 +01:00
Dr. Kashif Rasul 7d5e808a6c test for forward 2019-11-02 16:09:10 +01:00
Dr. Kashif Rasul 1bd9480d86 use moduledict 2019-11-02 15:34:14 +01:00
Dr. Kashif Rasul 75c8138b39 added feature test 2019-11-02 09:41:57 +01:00
Dr. Kashif Rasul 838ea1bc21 formatting 2019-11-01 13:28:10 +01:00
Dr. Kashif Rasul da74213018 formatting 2019-11-01 13:20:00 +01:00
Dr. Kashif Rasul d039d5dfe7 added test for distribution output 2019-11-01 13:17:59 +01:00
Kashif Rasul 02d43d0802 initial test 2019-10-31 22:19:39 +01:00