physai 2.5.2__tar.gz → 2.5.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {physai-2.5.2/src/physai.egg-info → physai-2.5.7}/PKG-INFO +1 -1
- {physai-2.5.2 → physai-2.5.7}/pyproject.toml +1 -1
- {physai-2.5.2 → physai-2.5.7}/src/physai/pinn.py +8 -2
- {physai-2.5.2 → physai-2.5.7/src/physai.egg-info}/PKG-INFO +1 -1
- {physai-2.5.2 → physai-2.5.7}/LICENSE +0 -0
- {physai-2.5.2 → physai-2.5.7}/README.md +0 -0
- {physai-2.5.2 → physai-2.5.7}/setup.cfg +0 -0
- {physai-2.5.2 → physai-2.5.7}/setup.py +0 -0
- {physai-2.5.2 → physai-2.5.7}/src/physai/__init__.py +0 -0
- {physai-2.5.2 → physai-2.5.7}/src/physai/losses.py +0 -0
- {physai-2.5.2 → physai-2.5.7}/src/physai/pde_residual.py +0 -0
- {physai-2.5.2 → physai-2.5.7}/src/physai/physics.py +0 -0
- {physai-2.5.2 → physai-2.5.7}/src/physai/trainer.py +0 -0
- {physai-2.5.2 → physai-2.5.7}/src/physai/utils.py +0 -0
- {physai-2.5.2 → physai-2.5.7}/src/physai/visualization.py +0 -0
- {physai-2.5.2 → physai-2.5.7}/src/physai.egg-info/SOURCES.txt +0 -0
- {physai-2.5.2 → physai-2.5.7}/src/physai.egg-info/dependency_links.txt +0 -0
- {physai-2.5.2 → physai-2.5.7}/src/physai.egg-info/requires.txt +0 -0
- {physai-2.5.2 → physai-2.5.7}/src/physai.egg-info/top_level.txt +0 -0
- {physai-2.5.2 → physai-2.5.7}/tests/test_pinn.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: physai
|
|
3
|
-
Version: 2.5.
|
|
3
|
+
Version: 2.5.7
|
|
4
4
|
Summary: Physics-Informed Neural Network (PINN) library for solving and animating ODEs/PDEs with visualization and training tools
|
|
5
5
|
Author-email: Mankrit Singh <whataninfinity@gmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "physai"
|
|
7
|
-
version = "2.5.
|
|
7
|
+
version = "2.5.7"
|
|
8
8
|
description = "Physics-Informed Neural Network (PINN) library for solving and animating ODEs/PDEs with visualization and training tools"
|
|
9
9
|
authors = [{name = "Mankrit Singh", email = "whataninfinity@gmail.com"}]
|
|
10
10
|
readme = "README.md"
|
|
@@ -4,7 +4,11 @@ import torch.optim as optim
|
|
|
4
4
|
from torch.amp import autocast
|
|
5
5
|
from torch.amp import grad_scaler as GradScaler
|
|
6
6
|
import warnings
|
|
7
|
-
|
|
7
|
+
try:
|
|
8
|
+
warnings.filterwarnings('ignore', category=torch.exceptions.ComplexHalfWarning)
|
|
9
|
+
except AttributeError:
|
|
10
|
+
# Ignore if the warning class doesn't exist (older PyTorch)
|
|
11
|
+
pass
|
|
8
12
|
|
|
9
13
|
class PINN(nn.Module):
|
|
10
14
|
"""Physics-Informed Neural Network (PINN) with advanced optimization features."""
|
|
@@ -53,7 +57,9 @@ class PINN(nn.Module):
|
|
|
53
57
|
imag = output[..., 1]
|
|
54
58
|
else:
|
|
55
59
|
raise ValueError(f"Expected output shape with last dim 2 for complex, got {output.shape}")
|
|
56
|
-
|
|
60
|
+
complex_output = torch.complex(real, imag) # PyTorch infers dtype from inputs
|
|
61
|
+
complex_output = complex_output.to(torch.complex64) # optional, ensure 32-bit
|
|
62
|
+
return complex_output
|
|
57
63
|
return output
|
|
58
64
|
|
|
59
65
|
def physics_loss(self, x, physics_fn):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: physai
|
|
3
|
-
Version: 2.5.
|
|
3
|
+
Version: 2.5.7
|
|
4
4
|
Summary: Physics-Informed Neural Network (PINN) library for solving and animating ODEs/PDEs with visualization and training tools
|
|
5
5
|
Author-email: Mankrit Singh <whataninfinity@gmail.com>
|
|
6
6
|
License: MIT
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|