Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update references to DeepXDE in about code and README #20

Merged
merged 1 commit into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
[![License](https://img.shields.io/github/license/chaobrain/pinnx)](https://github.com/chaobrain/pinnx/blob/master/LICENSE)

``PINNx`` is a library for scientific machine learning and physics-informed learning in JAX.
It is inspired from [DeepXDE](https://github.com/lululxvi/deepxde) but is enhanced by our
It is a rewrite of [DeepXDE](https://github.com/lululxvi/deepxde) but is enhanced by our
[Brain Dynamics Programming (BDP) ecosystem](https://ecosystem-for-brain-dynamics.readthedocs.io/).
For example, it leverages

Expand Down
5 changes: 4 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
========================

`PINNx <https://github.com/chaobrain/pinnx>`_ is a library for scientific machine learning and physics-informed learning
in JAX. It enables to define PINN problem with explicit variables (e.g. ``x``, ``y``, ``z``) and physical units
in JAX. It is rewritten according to `DeepXDE <https://github.com/lululxvi/deepxde>`_ but is enhanced by our
`Brain Dynamics Programming (BDP) ecosystem <https://ecosystem-for-brain-dynamics.readthedocs.io/>`_.

`PINNx` enables to define PINN problem with explicit variables (e.g. ``x``, ``y``, ``z``) and physical units
(e.g. ``meter``, ``second``, ``kelvin``) and to solve the problem with neural networks.

`PINNx <https://github.com/chaobrain/pinnx>`_ is built on top of our `Brain Dynamics Programming (BDP) ecosystem <https://ecosystem-for-brain-dynamics.readthedocs.io/>`_.
Expand Down
8 changes: 6 additions & 2 deletions pinnx/_trainer.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
# Rewrite of the original file in DeepXDE: https://github.com/lululxvi/deepxde
# ==============================================================================


import time
from typing import Union, Sequence, Callable, Optional

import brainstate as bst
import brainunit as u
import jax.tree
import jax.numpy as jnp
import jax.tree
import numpy as np

from pinnx.utils._display import training_display
from . import metrics as metrics_module
from . import utils
from .callbacks import CallbackList, Callback
from .problem.base import Problem
from .utils._display import training_display

__all__ = [
"Trainer",
Expand Down
4 changes: 3 additions & 1 deletion pinnx/callbacks.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Rewrite of the original file in DeepXDE: https://github.com/lululxvi/deepxde
# ==============================================================================

import sys
import time
from typing import Dict, Callable
Expand All @@ -9,7 +12,6 @@

from . import utils


__all__ = [
'Callback',
'CallbackList',
Expand Down
4 changes: 4 additions & 0 deletions pinnx/fnspace.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Rewrite of the original file in DeepXDE: https://github.com/lululxvi/deepxde
# ==============================================================================


__all__ = [
"FunctionSpace",
"PowerSeries",
Expand Down
14 changes: 1 addition & 13 deletions pinnx/geometry/base.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
# Copyright 2024 BDP Ecosystem Limited. All Rights Reserved.
#
# Licensed under the GNU LESSER GENERAL PUBLIC LICENSE, Version 2.1 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Rewrite of the original file in DeepXDE: https://github.com/lululxvi/deepxde
# ==============================================================================


Expand Down
14 changes: 1 addition & 13 deletions pinnx/geometry/geometry_1d.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
# Copyright 2024 BDP Ecosystem Limited. All Rights Reserved.
#
# Licensed under the GNU LESSER GENERAL PUBLIC LICENSE, Version 2.1 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Rewrite of the original file in DeepXDE: https://github.com/lululxvi/deepxde
# ==============================================================================

from typing import Literal, Union
Expand Down
15 changes: 2 additions & 13 deletions pinnx/geometry/geometry_2d.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
# Copyright 2024 BDP Ecosystem Limited. All Rights Reserved.
#
# Licensed under the GNU LESSER GENERAL PUBLIC LICENSE, Version 2.1 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Rewrite of the original file in DeepXDE: https://github.com/lululxvi/deepxde
# ==============================================================================

__all__ = ["Disk", "Ellipse", "Polygon", "Rectangle", "StarShaped", "Triangle"]

from typing import Union, Literal
Expand Down
17 changes: 3 additions & 14 deletions pinnx/geometry/geometry_3d.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
# Copyright 2024 BDP Ecosystem Limited. All Rights Reserved.
#
# Licensed under the GNU LESSER GENERAL PUBLIC LICENSE, Version 2.1 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Rewrite of the original file in DeepXDE: https://github.com/lululxvi/deepxde
# ==============================================================================

import itertools
from typing import Union, Literal

import jax.numpy as jnp
import brainstate as bst
import jax.numpy as jnp

from .geometry_2d import Rectangle
from .geometry_nd import Hypercube, Hypersphere
Expand Down
15 changes: 2 additions & 13 deletions pinnx/geometry/geometry_nd.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
# Copyright 2024 BDP Ecosystem Limited. All Rights Reserved.
#
# Licensed under the GNU LESSER GENERAL PUBLIC LICENSE, Version 2.1 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Rewrite of the original file in DeepXDE: https://github.com/lululxvi/deepxde
# ==============================================================================


import itertools
from typing import Literal

Expand Down
15 changes: 2 additions & 13 deletions pinnx/geometry/pointcloud.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
# Copyright 2024 BDP Ecosystem Limited. All Rights Reserved.
#
# Licensed under the GNU LESSER GENERAL PUBLIC LICENSE, Version 2.1 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Rewrite of the original file in DeepXDE: https://github.com/lululxvi/deepxde
# ==============================================================================

import brainstate as bst
import numpy as np

Expand Down
15 changes: 2 additions & 13 deletions pinnx/geometry/timedomain.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
# Copyright 2024 BDP Ecosystem Limited. All Rights Reserved.
#
# Licensed under the GNU LESSER GENERAL PUBLIC LICENSE, Version 2.1 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Rewrite of the original file in DeepXDE: https://github.com/lululxvi/deepxde
# ==============================================================================


import itertools

import brainstate as bst
Expand Down
15 changes: 2 additions & 13 deletions pinnx/icbc/base.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
# Copyright 2024 BDP Ecosystem Limited. All Rights Reserved.
#
# Licensed under the GNU LESSER GENERAL PUBLIC LICENSE, Version 2.1 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Rewrite of the original file in DeepXDE: https://github.com/lululxvi/deepxde
# ==============================================================================


import abc
from typing import Optional, Dict

Expand Down
4 changes: 3 additions & 1 deletion pinnx/icbc/boundary_conditions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"""Boundary conditions."""
# Rewrite of the original file in DeepXDE: https://github.com/lululxvi/deepxde
# ==============================================================================


from __future__ import annotations

Expand Down
3 changes: 2 additions & 1 deletion pinnx/icbc/initial_conditions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Initial conditions."""
# Rewrite of the original file in DeepXDE: https://github.com/lululxvi/deepxde
# ==============================================================================

from __future__ import annotations

Expand Down
5 changes: 4 additions & 1 deletion pinnx/metrics.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# Rewrite of the original file in DeepXDE: https://github.com/lululxvi/deepxde
# ==============================================================================


import brainunit as u
import jax


__all__ = [
'accuracy',
'l2_relative_error',
Expand Down
2 changes: 1 addition & 1 deletion pinnx/nn/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
]

from .base import NN
from .convert import DictToArray, ArrayToDict
from .deeponet import DeepONet, DeepONetCartesianProd, PODDeepONet
from .fnn import FNN, PFNN
from .convert import DictToArray, ArrayToDict
from .mionet import MIONetCartesianProd, PODMIONet
from .model import Model
14 changes: 1 addition & 13 deletions pinnx/nn/base.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
# Copyright 2024 BDP Ecosystem Limited. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Rewrite of the original file in DeepXDE: https://github.com/lululxvi/deepxde
# ==============================================================================


Expand Down
3 changes: 3 additions & 0 deletions pinnx/nn/deeponet.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Rewrite of the original file in DeepXDE: https://github.com/lululxvi/deepxde
# ==============================================================================

from typing import Union, Callable, Sequence, Dict, Optional

import brainstate as bst
Expand Down
3 changes: 3 additions & 0 deletions pinnx/nn/deeponet_strategy.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Rewrite of the original file in DeepXDE: https://github.com/lululxvi/deepxde
# ==============================================================================

from abc import ABC, abstractmethod


Expand Down
4 changes: 4 additions & 0 deletions pinnx/nn/mionet.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Rewrite of the original file in DeepXDE: https://github.com/lululxvi/deepxde
# ==============================================================================


from typing import Optional, Callable

import brainstate as bst
Expand Down
15 changes: 2 additions & 13 deletions pinnx/nn/model.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
# Copyright 2024 BDP Ecosystem Limited. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Rewrite of the original file in DeepXDE: https://github.com/lululxvi/deepxde
# ==============================================================================


from __future__ import annotations

from typing import Dict, Sequence
Expand Down
3 changes: 3 additions & 0 deletions pinnx/problem/base.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Rewrite of the original file in DeepXDE: https://github.com/lululxvi/deepxde
# ==============================================================================

from __future__ import annotations

import abc
Expand Down
4 changes: 4 additions & 0 deletions pinnx/problem/dataset_function.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Rewrite of the original file in DeepXDE: https://github.com/lululxvi/deepxde
# ==============================================================================


from typing import Callable, Sequence

import brainstate as bst
Expand Down
4 changes: 4 additions & 0 deletions pinnx/problem/dataset_general.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Rewrite of the original file in DeepXDE: https://github.com/lululxvi/deepxde
# ==============================================================================


from typing import Sequence, Dict

import brainstate as bst
Expand Down
4 changes: 4 additions & 0 deletions pinnx/problem/dataset_mf.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Rewrite of the original file in DeepXDE: https://github.com/lululxvi/deepxde
# ==============================================================================


import numpy as np

from pinnx.utils import run_if_any_none, standardize
Expand Down
4 changes: 4 additions & 0 deletions pinnx/problem/dataset_quadruple.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Rewrite of the original file in DeepXDE: https://github.com/lululxvi/deepxde
# ==============================================================================


from typing import Sequence

import brainstate as bst
Expand Down
4 changes: 4 additions & 0 deletions pinnx/problem/dataset_triple.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Rewrite of the original file in DeepXDE: https://github.com/lululxvi/deepxde
# ==============================================================================


from typing import Sequence

import brainstate as bst
Expand Down
4 changes: 4 additions & 0 deletions pinnx/problem/fpde.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Rewrite of the original file in DeepXDE: https://github.com/lululxvi/deepxde
# ==============================================================================


from __future__ import annotations

import math
Expand Down
4 changes: 4 additions & 0 deletions pinnx/problem/ide.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Rewrite of the original file in DeepXDE: https://github.com/lululxvi/deepxde
# ==============================================================================


from __future__ import annotations

from typing import Callable, Sequence, Union, Optional, Dict, Any
Expand Down
Loading
Loading