Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wavenet Estimator does not take minute frequency #159

Closed
cyrusmvahid opened this issue Jul 1, 2019 · 4 comments
Closed

Wavenet Estimator does not take minute frequency #159

cyrusmvahid opened this issue Jul 1, 2019 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@cyrusmvahid
Copy link

Description

(A clear and concise description of what the bug is.)

To Reproduce

(Please provide minimal example of code snippet that reproduces the error. For existing examples, please provide link.)

Error Message

(Paste the complete error message, including stack trace.)

Environment

  • Operating system:
  • Python version:
  • GluonTS version:

(Add as much information about your environment as possible, e.g. dependencies versions.)

@cyrusmvahid cyrusmvahid added the bug Something isn't working label Jul 1, 2019
@cyrusmvahid
Copy link
Author

cyrusmvahid commented Jul 1, 2019

Description:

I am trying to replicate the twit example with different estimators and compare the results.

wavenet_estimator = WaveNetEstimator(freq="5min", prediction_length=12, trainer=Trainer(epochs=EPOCHS))

I get the following result

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-130-bea3fc1bb39e> in <module>()
----> 1 wavenet_estimator = WaveNetEstimator(freq="5min", prediction_length=12, trainer=Trainer(epochs=EPOCHS))

~/anaconda3/envs/mxnet_p36/lib/python3.6/site-packages/gluonts/core/component.py in init_wrapper(*args, **kwargs)
    395                 self.__class__.__repr__ = validated_repr
    396 
--> 397             return init(self, **all_args)
    398 
    399         # attach the Pydantic model as the attribute of the initializer wrapper

~/anaconda3/envs/mxnet_p36/lib/python3.6/site-packages/gluonts/model/wavenet/_estimator.py in __init__(self, freq, prediction_length, trainer, num_eval_samples, cardinality, embedding_dimension, num_bins, hybridize_prediction_net, n_residue, n_skip, dilation_depth, n_stacks, temperature, act_type)
    162 
    163         seasonality = _get_seasonality(
--> 164             self.freq, {'H': 7 * 24, 'D': 7, 'W': 52, 'M': 12, 'B': 7 * 5}
    165         )
    166         goal_receptive_length = max(seasonality, 2 * self.prediction_length)

~/anaconda3/envs/mxnet_p36/lib/python3.6/site-packages/gluonts/model/wavenet/_estimator.py in _get_seasonality(freq, seasonality_dict)
     87         else {'H': 7 * 24, 'D': 7, 'W': 52, 'M': 12, 'B': 7 * 5}
     88     )
---> 89     seasonality = sdict[base_freq]
     90     if seasonality % multiple != 0:
     91         logging.warning(

KeyError: 'min'

Environment

Amazon SageMaker - mxnet-py36
I have installed gluonts manually
Linux ip-172-16-8-18 4.14.121-85.96.amzn1.x86_64 #1 SMP Wed May 22 00:45:50 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
mx.version: '1.4.1'

@lostella lostella changed the title Wavenet Estimator does not take the pandas frequency Wavenet Estimator does not take minute frequency Jul 1, 2019
@lostella
Copy link
Contributor

lostella commented Jul 1, 2019

Looks like just adding the support 'min' to the keys might work -- however I'm not sure if 'min': 60 * 7 * 24 could create memory issues

cc @geoalgo ?

@geoalgo
Copy link
Contributor

geoalgo commented Jul 1, 2019

I think it wont because the code has this safeguard:

goal_receptive_length = max(seasonality, 2 * self.prediction_length)

@lostella
Copy link
Contributor

Solved in #262

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants