KoopmanLab icon indicating copy to clipboard operation
KoopmanLab copied to clipboard

Demo code Question

Open AlderMen opened this issue 11 months ago • 1 comments

Hello, I downloaded the data of the Burgers equation you provided and inserted it into your demo program to run it, but an error message appeared:

These are the information of Burgers equation:

Burgers Dataset has been loaded successfully!
X train shape: torch.Size([1000, 256, 1]) Y train shape: torch.Size([1000, 256])
X test shape: torch.Size([200, 256, 1]) Y test shape: torch.Size([200, 256])
The autoencoder type is MLP.
KNO2d model is completed.
Koopman Model has been compiled!
The Model Parameters Number is  526026

This is the code error message: RuntimeError: mat1 and mat2 shapes cannot be multiplied (16384x1 and 10x32)

Could you help me solve this problem? Thanks a lot

AlderMen avatar Feb 27 '25 03:02 AlderMen

I have also encountered the same problem. This is because the training function has restrictions on the shape of the dataset. The demo defaults to training with data from the Navier-Stokes (NS) equations. The shape of the dataset should be: [number of samples, 256, 256, duration time] If you are dealing with a one-dimensional vector rather than a two-dimensional velocity field, you should select a one-dimensional algorithm in the koopman function. koopman_model = koopmanlab.model.koopman(backbone = "KNO1d", ……)

Williamlliw avatar Jun 24 '25 03:06 Williamlliw