Skip to content
This repository was archived by the owner on Apr 19, 2026. It is now read-only.
This repository was archived by the owner on Apr 19, 2026. It is now read-only.

Neural network for Turing equation #11

Description

Hello. I am able to run the Tutorial example with the Turing equation correctly. Now I am trying to extend that example by developing a neural network (nn) for the Turing equation, but I am getting error at the integration stage before training with any numerical data. Based on a tutorial example to create a nn, I am using the following to create a nn for the Turing equation:

# Run untrained neural net model

model_nn = models.PseudoLinearModel(equation, grid, 
                                    num_time_steps=4,  
                                    stencil_size=3, kernel_size=(3, 1), 
                                    num_layers=4, filters=32,
                                    constrained_accuracy_order=1, 
                                    learned_keys = {'A', 'B'}, 
                                    activation='relu')

tf.random.set_random_seed(0)

integrated_untrained = integrate.integrate_steps(model_nn, initial_state, time_steps)

I am getting the following error at the integrate.integrate_steps() step above.

anaconda2/envs/data-driven-pdes/lib/python3.6/site-packages/tensorflow/python/ops/nn_ops.py", line 1029, in __init__
    "input tensor must have rank %d" % (num_spatial_dims + 2))
ValueError: input tensor must have rank 4

I would appreciate your help in resolving the above error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions