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

Fitting fails with AR emissions #76

Open
bantin opened this issue Dec 13, 2019 · 2 comments
Open

Fitting fails with AR emissions #76

bantin opened this issue Dec 13, 2019 · 2 comments

Comments

@bantin
Copy link
Collaborator

bantin commented Dec 13, 2019

import ssm
true_lds = ssm.LDS(15, 10, dynamics="none", emissions="ar")
x, y = true_lds.sample(1000)

lds = ssm.LDS(15, 10, dynamics="none", emissions="ar")
lds.fit(y, method="svi", variational_posterior="mf")

fails because of a dimension mismatch when trying to initialize the ARHMM using KMeans. In the case of an LDS (as opposed toS LDS) the number of clusters passed to Kmeans is just 1, so it's pretty much a no-op anyway.

It's line 111 (observations.py) that fails, because the dimension of data is wrong -- it's T x T x D instead of T x D.

Seems like the cause might be here:

 xs = [self.emissions.invert(data, input, mask, tag)
              for data, input, mask, tag in zip(datas, inputs, masks, tags)]

This outputs a list where each entry is T x T x D.

bantin added a commit that referenced this issue Dec 13, 2019
@bantin
Copy link
Collaborator Author

bantin commented Dec 18, 2019

Addressed in 0e397ac

@bantin
Copy link
Collaborator Author

bantin commented Dec 18, 2019

• Generally, there is an issue here trying to call _invert in cases where it doesn't make sense. We should only try to call _invert if the emissions model has a single subspace and is not the NeuralNetwork emissions type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant