zabaras / transformer-physx

Transformers for modeling physical systems
https://zabaras.github.io/transformer-physx/
MIT License
127 stars 32 forks source link

Maybe a mistake in the current code. #3

Open shuizidesu opened 2 years ago

shuizidesu commented 2 years ago

Dear authors:

Thanks for your interesting and inspirational work! But I think there may be a minor mistake in the provided codes. In the file embedding_lorenz.py, the following codes are included

        # Test accuracy of one time-step
        for i in range(xInput.size(1)):
            xInput0 = xInput[:,i].to(device)
            g0 = self.embedding_model.embed(xInput0)
            yPred0 = self.embedding_model.recover(g0)
            yPred[:,i] = yPred0.squeeze().detach()

        test_loss = mseLoss(yTarget, yPred)

I think it should be

        # Test accuracy of one time-step
        for i in range(xInput.size(1)):
            xInput0 = xInput[:,i].to(device)
            g0 = self.embedding_model.embed(xInput0)
            g0 = self.embedding_model.koopmanOperation(g0)
            yPred0 = self.embedding_model.recover(g0)
            yPred[:,i] = yPred0.squeeze().detach()

        test_loss = mseLoss(yTarget, yPred)

for its practical effect.

HaoRyanLi commented 2 years ago

I agree. I have the same comment