Skip to content

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

Open
@JoeJoe1313

Description

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).

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions