Skip to content
Open
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
4 changes: 2 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ First official release of TorchPhysics on PyPI.
Version 1.0.1
=============
- Updated documentation and error messages
- Simplyfied creation/definition of DeepONets
- Add more evalution types for the DeepONet
- Simplified creation/definition of DeepONets
- Add more evaluation types for the DeepONet

Version 1.0.2
=============
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ to have a look at the following sections:

Installation
============
TorchPhysics reqiueres the follwing dependencies to be installed:
TorchPhysics requires the following dependencies to be installed:

- Python >= 3.8
- PyTorch_ >= 2.0.0
Expand Down Expand Up @@ -122,7 +122,7 @@ at the Robert Bosch GmbH, for support and supervision while creating this librar

Contribute
==========
If you are missing a feature or detect a bug or unexpected behaviour while using this library, feel free to open
If you are missing a feature or detect a bug or unexpected behavior while using this library, feel free to open
an issue or a pull request in GitHub_ or contact the authors. Since we developed the code as a student project
during a seminar, we cannot guarantee every feature to work properly. However, we are happy about all contributions
since we aim to develop a reliable code basis and extend the library to include other approaches.
Expand Down
2 changes: 1 addition & 1 deletion docs/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ One of the simplest applications is the forward solution of a Poisson equation:
u &= \sin(\frac{\pi}{2} x_1)\cos(2\pi x_2), \text{ on } \partial \Omega
\end{align}

This problem is part of the tutorial and is therefore explained with alot of details.
This problem is part of the tutorial and is therefore explained with a lot of details.
The corresponding implementation can be found here_.

.. _here : tutorial/solve_pde.html
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial/differentialoperators.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ that one has to only evaluate the function once and then can create arbitrary de

.. code-block:: python

# Therefore comput now the outputs:
# Therefore compute now the outputs:
out = f(x, t)

Let us compute the gradient and laplacian:
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial/model_creation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Parameters that should be learned in a inverse problem can also be easily define
.. code-block:: python

D_space = tp.spaces.R1('D') # parameters need there own space of corresponding dimension
D = tp.models.Parameter(init=0.0, space=D) # here you have to pass a fitting inital guess
D = tp.models.Parameter(init=0.0, space=D) # here you have to pass a fitting initial guess

That are all the basics to the creation of the networks and parameters, they could now be used in a
condition to then start the training.
Expand Down
6 changes: 3 additions & 3 deletions docs/tutorial/plotting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ plot_function
.. code-block:: python

def plot_fn(u):
return u # remeber u is the model outputs not the model itself
return u # remember u is the model outputs not the model itself

If we want to plot the laplcian w.r.t. :math:`x`, or any other kind of derivative:
If we want to plot the Laplacian w.r.t. :math:`x`, or any other kind of derivative:

.. code-block:: python

def plot_fn(u, x):
return tp.utils.laplcian(u, x)
return tp.utils.laplacian(u, x)

Or if we know the exact solution and want the error, we can compute this in there:

Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial/sampler_tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ in these domains. This task is handled by the **PointSampler**-class. Different
are implemented, for example:

- ``RandomUniformSampler``: samples uniform randomly distributed points, in the given domain.
To assure a efficent sampling, every domain implements are method to create random points.
To assure a efficient sampling, every domain implements are method to create random points.
- ``GridSampler``: samples a uniform point grid, in the given domain. Just like the
``RandomUniformSampler`` loosely coupled with the domains, for efficiency.
- ``GaussianSampler``: creates points with a normal/Gaussian distribution.
Expand Down
6 changes: 3 additions & 3 deletions docs/tutorial/solve_pde.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ equation itself and the boundary condition. Here, we start with the boundary con
bound_values = torch.sin(np.pi/2*x[:, :1]) * torch.cos(2*np.pi*x[:, 1:])
return u - bound_values

# the point sampler, for the trainig points:
# the point sampler, for the training points:
# here we use grid points any other sampler could also be used
bound_sampler = tp.samplers.GridSampler(square.boundary, n_points=5000)
bound_sampler = bound_sampler.make_static() # grid always the same, therfore static for one single computation
bound_sampler = bound_sampler.make_static() # grid always the same, therefore static for one single computation

Once all this is defined, we have to combine the residual and sampler in a ``condition``.
These condition handle internally the training process.
Expand Down Expand Up @@ -118,7 +118,7 @@ They can be found under the ``utils`` section.
def pde_residual(u, x):
return tp.utils.laplacian(u, x) + 4.25*np.pi**2*u

# the point sampler, for the trainig points:
# the point sampler, for the training points:
pde_sampler = tp.samplers.GridSampler(square, n_points=15000) # again point grid
pde_sampler = pde_sampler.make_static()
# wrap everything together in the condition
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial/solver_info.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ There, the behavior of the TorchPhysics ``Solver`` is explained and shown.
Here we rather want to mention some more details for the trainings process.

In general, most of the capabilities of Pytorch Lightning can also be used inside
TorchPhysics. All possiblities can be checked in the `Lightning documentation`_.
TorchPhysics. All possibilities can be checked in the `Lightning documentation`_.

.. _`beginning example`: solve_pde.html
.. _`Lightning documentation`: https://pytorch-lightning.readthedocs.io/en/stable/common/trainer.html
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorial/tutorial_domain_basics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ but for complex domains, the creation of training points will possibly become co
cut_domain = R - C

The boundary can be again called with ``.boundary``. Since the operation can create
complex domains the voluem can not always be computed. If a exact value is needed,
one has to set it over the ``set_volume`` methode.
complex domains the volume can not always be computed. If a exact value is needed,
one has to set it over the ``set_volume`` method.

Again we can have a look at the corresponding geometries:

Expand Down
10 changes: 5 additions & 5 deletions docs/tutorial/tutorial_spaces_and_points.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
Spaces and points in TorchPhysics
=================================
In this tutorial, we will cover the starting point for every PDE setting: The involved
spaces which define the names and dimensionlities of all variables.
spaces which define the names and dimensionalities of all variables.

Spaces
------
The class **Space** itself is quite lazy and basically consists of a counter collecting
dimensionlities of space variables. It's purpose is to define variable names that can later
dimensionalities of space variables. It's purpose is to define variable names that can later
be used, e.g. in user-defined functions. They therefore appear in several parts of TorchPhysics,
for example in the definition of domains or models.

Expand Down Expand Up @@ -55,7 +55,7 @@ Points
The ``Points`` object is another central part of TorchPhysics. It consists of a PyTorch-tensor
collecting a set of points in a ``Space``. It is generated e.g. by the samplers during training
and handed to and from all models as in- and output. However, for standard use-cases, ``Points``
mostly stay behind the scenes, so if you don't need custom behaviour when using TorchPhysics, feel
mostly stay behind the scenes, so if you don't need custom behavior when using TorchPhysics, feel
free to skip this part of the tutorial for now.

``Points`` store data in a tensor with 2-axis, the first corresponding the batch-dimension in a batch
Expand All @@ -78,9 +78,9 @@ All ``Points`` have a space and therefore also a dimensionality and a variable s
>>> points.dim
3
We can access the contents of a ``Points`` object in a single tensor or with the corresponding coordinate
dict using ``.as_tensor`` or ``.coordinates`` attribues. ``Points`` also support most torch functions that
dict using ``.as_tensor`` or ``.coordinates`` attributes. ``Points`` also support most torch functions that
work on tensors and support slicing via keys along the ordered variable axis, regarding the last key in slicing
(similar to NumPy or PyTorch-behaviour):
(similar to NumPy or PyTorch-behavior):

.. code-block:: python

Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial/tutorial_start.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Conditions

Solver
Handles the training of the defined model, by applying the previously created conditions.
The usage of the solver is shown the beginnig example for `solving a simple PDE`_. More details
The usage of the solver is shown the beginning example for `solving a simple PDE`_. More details
of the trainings process are mentioned here_.

.. _here: solver_info.html
Expand Down
Loading