Skip to content
Back to skills

Physics Informed Neural Networks

ASecurity

Use when building physics-informed neural networks.

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 10, 2026
ai-agentspythonaws

Security analysis

A100/100

Scanned September 10, 2026

npx -y skills add LoopyLuci/Skills --skill physics-informed-neural-networks --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Physics Informed Neural Networks?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Physics Informed Neural Networks
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/loopyluci-physics-informed-neural-networks/badge)](https://www.skillsdirectory.com/skills/loopyluci-physics-informed-neural-networks)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: physics-informed-neural-networks
description: "Use when building physics-informed neural networks."
version: 1.0.0
author: Hermes Agent
license: MIT
metadata:
  hermes:
    tags: [PINNs, physics-informed, PDE, scientific-ML, neural-operator, simulation]
    related_skills: [custom-training-loops, custom-loss-activation-functions, transformer-architectures, timeseries-foundation-models]
---

# Physics-Informed Neural Networks

Building physics-informed neural networks (PINNs) — from PDE residual loss through neural operators, Fourier features, and scientific ML applications.

## When to Use

- Solving PDEs with neural networks
- Incorporating physical laws into ML models
- Surrogate modeling for simulations
- Inverse problems (parameter discovery from data)
- Scientific ML applications

## PINN Implementation

```python
import torch
import torch.nn as nn

class PINN(nn.Module):
    """Physics-Informed Neural Network for solving PDEs."""
    def __init__(self, layers: List[int]):
        super().__init__()
        self.net = self._build(layers)
    
    def _build(self, layers):
        modules = []
        for i in range(len(layers)-1):
            modules.append(nn.Linear(layers[i], layers[i+1]))
            if i < len(layers)-2: modules.append(nn.Tanh())
        return nn.Sequential(*modules)
    
    def forward(self, x, t):
        return self.net(torch.cat([x, t], dim=1))

def pde_loss(model, x, t):
    """Loss: PDE residual (Burgers equation: u_t + u*u_x = ν*u_xx)."""
    x.requires_grad_(True); t.requires_grad_(True)
    u = model(x, t)
    
    # Compute gradients
    u_t = torch.autograd.grad(u, t, torch.ones_like(u), create_graph=True)[0]
    u_x = torch.autograd.grad(u, x, torch.ones_like(u), create_graph=True)[0]
    u_xx = torch.autograd.grad(u_x, x, torch.ones_like(u_x), create_graph=True)[0]
    
    nu = 0.01  # Viscosity
    residual = u_t + u * u_x - nu * u_xx
    return torch.mean(residual**2)
```

## Verification Checklist

- [ ] PDE defined with initial/boundary conditions
- [ ] Network architecture deep enough for solution complexity
- [ ] Fourier features for high-frequency solutions
- [ ] Collocation points sampled (Latin Hypercube, adaptive)
- [ ] Loss terms weighted (PDE residual + BC + IC + data)
- [ ] Training converges (monitor each loss component)
- [ ] Solution validated against analytical or numerical reference

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.