Skip to content

How to create my own system to work through collab notebooks with #206

Answered by drgona
MatisPatel asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @MatisPatel, yeah I see how this can get confusing. Our PSL submodule is to be deprecated as it is overloaded with both pytorch and numpy backend.
For ODEs we encourage the users to use Classes in our ode.py.

I encourage you to have a look at this ODE example

Here, we define a custom ODE class for the Brusselator system as follows:

class BrusselatorParam(ODESystem):
    def __init__(self, insize=2, outsize=2):
        """

        :param insize:
        :param outsize:
        """
        super().__init__(insize=insize, outsize=outsize)
        self.alpha = nn.Parameter(torch.tensor([5.0]), requires_grad=True)
        self.beta = nn.Parameter(torch.tensor([5.0]), requires_grad=True)
  …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by drgona
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants