Giter Club home page Giter Club logo

pinn-pytorch's Issues

Burgers 2D Notebook not running properly

When executing Burger 2D.ipynb I get the following error:

model.train()
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
Input In [5], in <cell line: 1>()
----> 1 model.train()

File ~/code/pinn-pytorch/grad/pytorchPDE.py:111, in PytorchPDE.train(self, epochs, save_step, update_step, upload)
    107 self.optimizer.zero_grad()
    109 # forward + backward + optimize
--> 111 loss = self.loss()
    113 # if(upload):
    114 #     neptune.log_metric('loss', loss.item())
    116 loss.backward()

File ~/code/pinn-pytorch/grad/pytorchPDE.py:56, in PytorchPDE.loss(self)
     48             second_grads = None
     50 #         print('train_tag_min: ', self.train_tag[:,-1].min())
     51 #         print('train_tag_max: ', self.train_tag[:,-1].max())
     52 #         print('predicts_min: ', predicts.min())
     53 #         print('first_grads_min: ', first_grads.min())
     54 #         print('second_grads_min: ', second_grads[0].min(), second_grads[0].min())
---> 56         domain_loss = self.pde(train_points, predicts, first_grads, second_grads)*self.train_tag[:,-1]
     57         boundary_loss = 0
     58         for i, bc in enumerate(self.data.bcs):

Input In [4], in pde(x, y, first_grads, second_grads)
      1 def pde(x,y,first_grads,second_grads):
      2 #     print(second_grads)
----> 3     return first_grads[:,0] + y[:,0]*first_grads[:,1] - (0.01/np.pi)*second_grads[1][:,1]

IndexError: tuple index out of range

Package versions:

python=3.9.12
torch=1.11.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.