WassimTenachi / PhySO

Physical Symbolic Optimization
https://physo.readthedocs.io/
MIT License
1.81k stars 249 forks source link

Question about necessary X.shape #40

Closed M-Colley closed 1 year ago

M-Colley commented 1 year ago

Hey,

in sr.py, there is the following assertion assert len(X.shape) == 2, "X must have shape = (n_dim, data_size,)".

Why must X be in this shape?

Wouldn't it also work with 1-dimensional x and 1-dimensional y data?

Kind regards

WassimTenachi commented 1 year ago

Hi @M-Colley,

Sorry for the delayed response.

Yes the package works with 1D X and 1D y. You can see an example of that here: https://github.com/WassimTenachi/PhySO/blob/main/demo/demo_damped_harmonic_oscillator/demo_damped_harmonic_oscillator.ipynb

The expected shape of X is (1000, 1) for 1000 datapoints in 1D and (1000,3) for 1000 data points in 3D for example. This snippet of code just checks that the length of this shape is 2 as this is the expected format !

Kind regards. Wassim

WassimTenachi commented 1 year ago

Please consider closing this issue if this answers your questions !

M-Colley commented 1 year ago

Ahhh I see, thanks!