Skip to main content

PINN-kit

A toolkit for Physics-Informed Neural Networks (PINNs). This package provides tools and utilities for implementing and training physics-informed neural networks for solving differential equations.

Features

  • Easy-to-use interface for defining physics-informed neural networks
  • Support for various types of differential equations
  • Flexible domain handling utilities for arbitrary input variables
  • Advanced meshgrid functionality for multi-dimensional problems
  • Training and evaluation tools

Installation

PINN-kit supports macOS, Linux, and Windows. You can install it using pip, which will also automatically install all required dependencies, including torch.

It is recommended to use a virtual environment with Python 3.12 to avoid dependency conflicts.

macOS & Linux

python3.12 -m venv venv
source venv/bin/activate

Windows

Open Command Prompt or PowerShell and run:

python3.12 -m venv venv
venv\Scripts\activate

Install PINN-kit

macOS & Linux

pip install pinn-kit

Windows

Open Command Prompt or PowerShell and run:

pip install pinn-kit

Note: There is no need to install torch separately; it will be installed automatically with pinn-kit.

PINN-kit is easy to use

from pinn_kit import PINN, Domain, convert_to_meshgrid
import numpy as np

# Create a domain with flexible variable definition
domain = Domain([
    ('x', -1, 1),  # x-coordinate bounds
    ('y', -1, 1),  # y-coordinate bounds
    ('t', 0, 1)    # time bounds
])

# Sample points using various strategies
x_arr, y_arr, t_arr = domain.sample_points(
    num_samples=1000,
    sampler="lhs_classic"  # Latin Hypercube Sampling
)

# Create meshgrid from 1D arrays (new flexible interface)
x_1d = np.linspace(-1, 1, 50)
y_1d = np.linspace(-1, 1, 50)
t_1d = np.linspace(0, 1, 10)
xx, yy, tt = convert_to_meshgrid([x_1d, y_1d, t_1d])

# Initialize a PINN
pinn = PINN([3, 20, 20, 1])  # 3 inputs, 2 hidden layers, 1 output

# Define the loss terms
def loss():
    return loss_function

# Train the network
pinn.train_model([x_arr, y_arr, t_arr], loss_list, num_epochs=1000)

Documentation

For detailed documentation, please visit our documentation page.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Metadata

Release files for pinn-kit 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pinn-kit 0.1.5
File Size Uploaded Provenance Actions
pinn_kit-0.1.5.tar.gz 19.3 kB Without provenance Details for pinn_kit-0.1.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pinn-kit 0.1.5
File Interpreter ABI Platform Actions
pinn_kit-0.1.5-py3-none-any.whl Python 3 none any Details for pinn_kit-0.1.5-py3-none-any.whl

Total release size: 31.0 kB

Release files / pinn_kit-0.1.5.tar.gz

Download URL pinn_kit-0.1.5.tar.gz
Size 19.3 kB
Tags Source
SHA-256 checksum
How to use checksums
255cf4eebf6298198da68a3d623951b18b5e6c0fb379abbf20463c6e87556cba
BLAKE2b-256 checksum
How to use checksums
8b128f99d69e8351f6ee46120b509acd5c1827e68e6c63cc77861551d7e62b22
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.10

Release files / pinn_kit-0.1.5-py3-none-any.whl

Download URL pinn_kit-0.1.5-py3-none-any.whl
Size 11.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b7c060a1495fcf9e4ed10df19fb8860aa83e59004d614d811baaf497503d68f0
BLAKE2b-256 checksum
How to use checksums
ef1581f2e5c65e1e2fdc386211a73c8d58ebd97d5f2bbf059faa6a1a3bdf66dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.10

Security for pinn-kit 0.1.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page