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

ValueError when attempting to run ExperimentBeijing with rank higher than 1 #2

Open
JoeJoe1313 opened this issue Jun 27, 2024 · 0 comments

Comments

@JoeJoe1313
Copy link

JoeJoe1313 commented Jun 27, 2024

I am attempting to execute make ExperimentBeijing with rank (

) higher than 1 and get the following error:

Traceback (most recent call last):
  File "/Users/ljoana/repos/rPSMF/ExperimentBeijing/beijing_psmf.py", line 171, in <module>
    main()
  File "/Users/ljoana/repos/rPSMF/ExperimentBeijing/beijing_psmf.py", line 151, in main
    psmf.run(
  File "/Users/ljoana/repos/rPSMF/ExperimentBeijing/beijing_psmf.py", line 71, in run
    self.step(y_train, i, T)
  File "/Users/ljoana/repos/rPSMF/pypsmf/psmf/psmf.py", line 77, in step
    self.inner(i, k, y[k])
  File "/Users/ljoana/repos/rPSMF/pypsmf/psmf/psmf.py", line 81, in inner
    P_bar = self._predictive_covariance(i, k)
  File "/Users/ljoana/repos/rPSMF/pypsmf/psmf/psmf.py", line 103, in _predictive_covariance
    F = F.squeeze(axis=1).squeeze(axis=2)
ValueError: cannot select an axis to squeeze out which has size not equal to one
make: *** [ExperimentBeijing/output/periodic_bases.pdf] Error 1

I noticed that the shape of the nonlinearity output in FourierBasis

is (r, r) (based on the paper it should be (r, 1)), and that in the comments in _predictive_covariance()

rPSMF/pypsmf/psmf/psmf.py

Lines 107 to 113 in 93ac689

def _predictive_covariance(self, i, k):
F = self._jacfunc(self._theta[i - 1], self._mu[k - 1], k)
# The output of the Jacobian is (r, 1, r, 1), since the input, mu, to
# the nonlinearity is (r, 1) and it outputs an array of the same size.
# We need F to be an (r, r) matrix, so we squeeze out the second and
# fourth axes.
it is stated that The output of the Jacobian is (r, 1, r, 1), since the input, mu, to the nonlinearity is (r, 1) and it outputs an array of the same size..., but in reality the input is (r, r) and the Jacobian is (r, r, r, 1).

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