Closed EthanJamesLew closed 3 months ago
Great, Thank you! @EthanJamesLew There seems to be an issue when only 1 trajectory is used, an error is thrown. The issue seems to be due to the size of weights being 1. The computed Atilde in this case in sw-edmdc is None. You can recreate the issue by setting the number of training trajectories in the weighted-cost-func.ipynb notebook to 1.
It seems the issue isn't just for a low number of trajectories, but in general when sw-edmdc fails to find a solution, which may be related to limited data. @EthanJamesLew
@Abdu-Hekal I can certainly present an error for that. However, would it be better to present a warning and switch to unweighted eDMD?
@EthanJamesLew Yes I agree! Is this issue simply inherent due to the approach, where it just fails to find a reasonable solution due to limited data?
@Abdu-Hekal I will investigate...
Also, I have another idea for reweighting--to move some of the reweighting to the RFFs in addition to the DMD stage. I will attend to this and then play with reweighting the observables directly (data-adaptive).
Perfect! @EthanJamesLew I will revert back to testing with previous weighting method in the meantime
@Abdu-Hekal added regularization for the sparse data case. I think it's ready to try now.
@EthanJamesLew Great! No errors now. The fit for the weighted approach though seems to be much worse. For reference I am attaching two images, one with weighting and one without for learning the Automatic transmission model with 1 training trajectory. I am using a weight of one for all point so the result is expected to be the same.
The poorly learnt model with weighting reminds of issues with normalization, is there something similar going on here?
@Abdu-Hekal I can guess what's going on (large state values cause numerical instability during optimization). However, to avoid wasting your time, can you please see me a couple of those trajectories so that I can test them on my machine. A simple CSV or mat file will do. Thanks
@EthanJamesLew Sent them, Thank you!
@EthanJamesLew Maybe we should investigate the discrepancy when using different weights, where weights are the same for all points and all trajectories. We should ideally expect the same results if all weights are equal. Whilst using a weight of 1e-4 no explosion in values occurs, falsification results are much worse for the majority of benchmarks. Using a weight of 1 seems to give comparable results to non-weighted, despite very bad learning for a trainset of 1-2 trajectories, as it stabilizes later on. Maybe we could investigate different solvers as well, which might also help reduce runtime.
@Abdu-Hekal I changed SW-eDMD to use rank adaptation. It now performs better on the sparsity examples that I tested
Summary
This is an implementation of our novel eDMD algorithm that allows states and snapshots to be weighted. A conversion is done in the objective to translate weights on state to weights on observables.
weighted-cost-func.ipynb
has a complete example of the methodCC @Abdu-Hekal