Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example ode_demo using y**3? #11

Open
pswpswpsw opened this issue Jun 4, 2021 · 0 comments
Open

Example ode_demo using y**3? #11

pswpswpsw opened this issue Jun 4, 2021 · 0 comments

Comments

@pswpswpsw
Copy link

pswpswpsw commented Jun 4, 2021

This example ode_demo.py under Example is considering a NN with input cubic nonlinearity. Since the original dynamics is y**3 so it seems a bit weird. This implies that as long as the NN is learning the linear matrix mapping, it will work.

class ODEFunc(tf.keras.Model):
    def __init__(self, **kwargs):
        super(ODEFunc, self).__init__(**kwargs)

        self.x = tf.keras.layers.Dense(50, activation='tanh',
                                   kernel_initializer=tf.keras.initializers.TruncatedNormal(stddev=0.1))
        self.y = tf.keras.layers.Dense(2,
                                   kernel_initializer=tf.keras.initializers.TruncatedNormal(stddev=0.1))

    def call(self, t, y):
        y = tf.cast(y, tf.float32)
        x = self.x(y ** 3)
        y = self.y(x)
        return y

Question

When I turned it back to y, so using NN to fully learning the dynamics, (see below) it doesn't converge and seems stuck at somewhere. Does anyone have success in using NODE for this simple example?

098

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant