Closed EthanJamesLew closed 5 months ago
Ideally for every N*M trajectory with N state variables and M time-steps, we could pass a N*M matrix of weights. So for a set of trajectories we have a set of these matrices. This would give use control over weights for each trajectory, state variable and time point
@Abdu-Hekal does this code work for you?
@Abdu-Hekal ping
@EthanJamesLew code runs well, Thank you!
@EthanJamesLew Is it possible to have the weights defined for each state variable? so that different state variables can have different weights?
@Abdu-Hekal I believe that is doable as is (pass in a T x N x M array instead of T x M array), but lemme check
@EthanJamesLew I am getting the following error when I try it: Error: operands could not be broadcast together with shapes (101,2) (101,) I assume it multiplies each row of the variables difference by the full array of weights and not the corresponding row
@Abdu-Hekal I see the issue--try now?
@EthanJamesLew Still getting the same error
@Abdu-Hekal interesting. The GitHub CI/CD seemed to be okay with it: https://github.com/EthanJamesLew/AutoKoopman/actions/runs/8251423166/job/22568416799 (it ran the jupyter notebook with the updated example)
@EthanJamesLew Interesting, when I run the notebook I first get this error: AttributeError: 'UniformTimeTrajectory' object has no attribute 'abs'. Then I replace w = traj.abs().states with just w=abs(traj.states), and I run into the same error as before: Error: operands could not be broadcast together with shapes (101,2) (101,)
@Abdu-Hekal I did just add the abs
method to trajectories objects, so maybe the autokoopman version being imported is not at HEAD. In any case, I know GH comments is not the best troubleshooting experience--maybe we could setup a brief pair programming session this week (I can do 8am PT Thu--the time we normally meet on Friday)?
@EthanJamesLew Sounds good! In the meantime I will try to fix the issue on my end.
@EthanJamesLew All good, Notebook Kernel just needed restarting :) I am sometimes getting this warning though but does not seem detrimental RuntimeWarning: overflow encountered in matmul return np.real(self._A @ obs.T).flatten()[: len(x)]
Great! Closing for now
Summary
CC @Abdu-Hekal