Giter VIP home page Giter VIP logo

tpinn's Introduction

Tensorized Deep Physics Informed Neural Networks :atom:

This repository contains an implementation of Tensorized Physics Informed Neural Networks (TPINNs) for solving physics-based problems. TPINNs combine the power of neural networks with the physical laws governing the system to improve accuracy and generalization. πŸš€

πŸ“š Introduction

Tensorized Physics Informed Neural Networks (TPINNs) are a class of neural networks that incorporate known physical laws into their architecture. By including the governing equations of a system as constraints, TPINNs can solve complex physics-based problems more accurately than traditional neural networks. This repository provides an implementation of TPINNs using TensorFlow. ♾️

βœ”οΈ Requirements

To run the code in this repository, you need the following dependencies:

  • Python (>= 3.6)
  • TensorFlow (>= 2.0)
  • NumPy (>= 1.18)

πŸ’Ύ Installation

  1. Clone the repository:
    git clone [email protected]:mvanzulli/TPINN.git
    
  2. Navigate to the project directory:
    cd TPINN
    
  3. Install the required dependencies:
    pip install -r requirements.txt
    

πŸ’» Usage

To utilize TPINNs in your own projects, follow these steps:

  1. Import the necessary modules:

    import tensorflow as tf
    import numpy as np
    from tn_layer import TNLayer
    from tn_model import TNModel
  2. Create an instance of the TNLayer class:

    tn_layer = TNLayer(input_dim, bond_dim, activation, kernel_initializer, use_bias, bias_initializer)

    Replace the arguments with the desired values. input_dim is the dimensionality of the input tensor, bond_dim is the bond dimension of the TN layer, activation is the activation function to use, kernel_initializer is the initializer for the weight matrices, use_bias specifies whether to include a bias term, and bias_initializer is the initializer for the bias term.

  3. Create an instance of the TNModel class:

    tn_model = TNModel(num_layers, MPO_units, output_dim, bond_dim, activation, use_bias, kernel_initializer, bias_initializer, dif_equation)

    Replace the arguments with the desired values. num_layers is the number of TN layers, MPO_units is the number of units in the MPO tensor, output_dim is the dimension of the output, bond_dim is the bond dimension of the TN layer (optional), activation is the activation function to use, use_bias specifies whether to include a bias term, kernel_initializer is the initializer for the weight matrices, bias_initializer is the initializer for the bias term, and dif_equation is a callable representing the one-dimensional fourth-order PDE.

  4. Use the TNModel to perform forward pass and compute the PDE loss:

    y_pred = tn_model.call(x)
    pde_loss = tn_model.compute_pde_loss(x)

    Replace x with the input tensor.

πŸš€ Examples

An example usage of TPINNs can be found in the examples directory. It demonstrates how to solve a physics-based problem using TPINNs.

πŸ‘₯ Contributing

Contributions to this repository are welcome. Feel free to open issues or submit pull requests.

πŸ“ƒ License

This project is licensed under the MIT License.

tpinn's People

Contributors

mvanzulli avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

tpinn's Issues

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.