You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered some errors while using the EKF filtering for performing BIP inference both from my code and from the minimal.py example that is provided. The corresponding fixes can be seen in the commit: souljaboy764/intprim@4ab692c
Long Version:
I was trying to use the EKF filter for performing the performing inference with the BIP, but was getting the following error:
File "build/bdist.linux-x86_64/egg/intprim/bayesian_interaction_primitives.py", line 298, in generate_probable_trajectory_recursive
File "build/bdist.linux-x86_64/egg/intprim/filter/spatiotemporal/ekf.py", line 157, in localize
File "build/bdist.linux-x86_64/egg/intprim/filter/spatiotemporal/nonlinear_system.py", line 109, in get_measurement_model
File "build/bdist.linux-x86_64/egg/intprim/basis/basis_model.py", line 91, in get_weighted_vector_derivative
IndexError: invalid index to scalar variable.
I thought it might have been an issue in my code but I was getting this issue even when I was running minimal.py with the EKF filter. I am getting the issue in both python2 and python3.
File "build/bdist.linux-x86_64/egg/intprim/bayesian_interaction_primitives.py", line 298, in generate_probable_trajectory_recursive
File "build/bdist.linux-x86_64/egg/intprim/filter/spatiotemporal/ekf.py", line 157, in localize
File "build/bdist.linux-x86_64/egg/intprim/filter/spatiotemporal/nonlinear_system.py", line 110, in get_measurement_model
File "build/bdist.linux-x86_64/egg/intprim/basis/basis_model.py", line 50, in get_block_diagonal_basis_matrix
ValueError: could not broadcast input array from shape (8) into shape (8,1)
The docstrings of the get_basis_functions function for all the different basis functions state that the shape of the return value would be shape(degree, ) if x is a scalar. so I am able to fix this by expanding the dimensions of the value returned by the function:
File "build/bdist.linux-x86_64/egg/intprim/bayesian_interaction_primitives.py", line 298, in generate_probable_trajectory_recursive
File "build/bdist.linux-x86_64/egg/intprim/filter/spatiotemporal/ekf.py", line 157, in localize
AttributeError: 'GaussianModel' object has no attribute 'inverse_transform'
After digging further, I saw that the only use of inverse_transform is for the scalers and not for any basis functions. Maybe it is from a previous version? I changed that part of the code to how it is in kf.py:
TL;DR
I encountered some errors while using the EKF filtering for performing BIP inference both from my code and from the
minimal.py
example that is provided. The corresponding fixes can be seen in the commit: souljaboy764/intprim@4ab692cLong Version:
I was trying to use the EKF filter for performing the performing inference with the BIP, but was getting the following error:
I thought it might have been an issue in my code but I was getting this issue even when I was running
minimal.py
with the EKF filter. I am getting the issue in both python2 and python3.The stack trace shows the error in
basis_model.py
in theget_weighted_vector_derivative
function at the following line:intprim/intprim/basis/basis_model.py
Line 91 in 8994b15
On reading the docstring of the function, it says:that
x
should be a scalar value:intprim/intprim/basis/basis_model.py
Line 78 in 8994b15
I am able to resolve this issue with dropping the index used for
x
and the line now looks like:After fixing the above, I get the next error:
On looking further, I saw that the phase value
x
passed to theget_block_diagonal_basis_matrix
function inbasis_model.py
is a scalar value, which is used here:intprim/intprim/basis/basis_model.py
Line 48 in 8994b15
The docstrings of the
get_basis_functions
function for all the different basis functions state that the shape of the return value would beshape(degree, ) if x is a scalar.
so I am able to fix this by expanding the dimensions of the value returned by the function:Since this is the same case in the
get_block_diagonal_basis_matrix_derivative
function, I felt a similar change there would fit.The next error I get is:
which is basically this line:
intprim/intprim/filter/spatiotemporal/ekf.py
Line 157 in 8994b15
After digging further, I saw that the only use of
inverse_transform
is for the scalers and not for any basis functions. Maybe it is from a previous version? I changed that part of the code to how it is inkf.py
:The text was updated successfully, but these errors were encountered: