Skip to content

Commit

Permalink
fix trend model to work in symbolic mode (#578)
Browse files Browse the repository at this point in the history
* fix trend model to work in symbolic mode

* explicitly enable hybridization
  • Loading branch information
lostella authored Jan 30, 2020
1 parent 6693927 commit 42f512a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/gluonts/model/deepstate/issm.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,7 @@ def transition_coeff(
F = getF(seasonal_indicators)

_transition_coeff = (
# TODO: this won't work if F == mx.sym
F.array([[1, 1], [0, 1]])
(F.diag(F.ones(shape=(2,)), k=0) + F.diag(F.ones(shape=(1,)), k=1))
.expand_dims(axis=0)
.expand_dims(axis=0)
)
Expand Down
5 changes: 4 additions & 1 deletion test/model/test_deepstate_smoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@
common_estimator_hps = dict(
freq="D",
prediction_length=3,
trainer=Trainer(epochs=3, num_batches_per_epoch=2, batch_size=1),
trainer=Trainer(
epochs=3, num_batches_per_epoch=2, batch_size=1, hybridize=True
),
past_length=10,
add_trend=True,
)


Expand Down

0 comments on commit 42f512a

Please sign in to comment.