Giter Club home page Giter Club logo

Comments (2)

akoryagin avatar akoryagin commented on June 4, 2024

Hey, @NirvikNU, thanks for the issue!

Judging by this line in the traceback

'form': lambda u, t: D(u, t) - 2 * np.pi * 2 * t^3

you're trying to solve an equation with t cubed in the right-hand side of the equation. The thing is, exponentiation in Python is performed using double stars **. So, the line should look like

'form': lambda u, t: D(u, t) - 2 * np.pi * 2 * t**3

Best,
Alex

from pydens.

NirvikNU avatar NirvikNU commented on June 4, 2024

Sorry for posting the wrong traceback, this is the correct one:

Traceback (most recent call last):

  File "<ipython-input-26-1b5c74329633>", line 1, in <module>
    runfile('/home/nirvik/Documents/neuronal_model_python/temp.py', wdir='/home/nirvik/Documents/neuronal_model_python')

  File "/usr/lib/python3/dist-packages/spyder/utils/site/sitecustomize.py", line 705, in runfile
    execfile(filename, namespace)

  File "/usr/lib/python3/dist-packages/spyder/utils/site/sitecustomize.py", line 102, in execfile
    exec(compile(f.read(), filename, 'exec'), namespace)

  File "/home/nirvik/Documents/neuronal_model_python/temp.py", line 38, in <module>
    dg = Solver(config)

  File "/home/nirvik/.local/lib/python3.6/site-packages/pydens/wrapper.py", line 21, in __init__
    self.model = model_class(config)

  File "/home/nirvik/.local/lib/python3.6/site-packages/pydens/batchflow/batchflow/models/tf/base.py", line 262, in __init__
    super().__init__(*args, **kwargs)

  File "/home/nirvik/.local/lib/python3.6/site-packages/pydens/batchflow/batchflow/models/base.py", line 38, in __init__
    self.build(*args, **kwargs)

  File "/home/nirvik/.local/lib/python3.6/site-packages/pydens/batchflow/batchflow/models/tf/base.py", line 331, in build
    config = self.build_config()

  File "/home/nirvik/.local/lib/python3.6/site-packages/pydens/model_tf.py", line 117, in build_config
    n_parameters = get_num_parameters(form[0])

  File "/home/nirvik/.local/lib/python3.6/site-packages/pydens/syntax_tree.py", line 77, in get_num_parameters
    tree = form(*[SyntaxTreeNode('_' + str(i)) for i in range(n_args)])

  File "/home/nirvik/Documents/neuronal_model_python/temp.py", line 25, in <lambda>
    'form': lambda u, t: D(u, t) - 2 * np.pi * 2*t**3,

  File "/home/nirvik/.local/lib/python3.6/site-packages/pydens/tokens.py", line 63, in <lambda>
    if isinstance(args[0], SyntaxTreeNode) else method_(*args, **kwargs))

  File "/home/nirvik/.local/lib/python3.6/site-packages/pydens/letters.py", line 82, in D
    return np.stack([self.D(func, coordinate) for coordinate in coordinates],

TypeError: 'SyntaxTreeNode' object is not iterable

Also the same error persists with the original solved example for ODE I posted above.

from pydens.

Related Issues (20)

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.