Skip to content

Commit

Permalink
hide mc and coupling example
Browse files Browse the repository at this point in the history
  • Loading branch information
enigne committed Jun 6, 2024
1 parent 219dd68 commit 098aa00
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions docs/examples/advanced.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,33 @@ It is possible to add additional loss functions to the total loss. Here is an ex
vel_loss['weight'] = 1.0e-6
hp["additional_loss"] = {"vel":vel_loss}
In this example, we define a `dict` which contains:
- `name`: A user-defined name for the loss function.
- `function`: A function ID from `LOSS_DICT` in `deepxde.losses <https://deepxde.readthedocs.io/en/latest/_modules/deepxde/losses.html#get>`_ or `pinnicle.utils.data_misfit <https://pinnicle.readthedocs.io/en/latest/_modules/pinnicle/utils/data_misfit.html#get>`_. These lists include most commonly used loss functions, such as `"mean"`, `"MAE"`, `"MSE"`, `"MAPE"`, `"zero"`, `"VEL_LOG"`, `"MEAN_SQUARE_LOG"`, etc. Before writing your own loss function, refer to these lists, as these functions are optimized with the backends.
- `weight`: the weight of this loss function.
In this example, we define a ``dict`` which contains:
- ``name``: A user-defined name for the loss function.
- ``function``: A function ID from ``LOSS_DICT`` in ``deepxde.losses <https://deepxde.readthedocs.io/en/latest/_modules/deepxde/losses.html#get>``_ or ``pinnicle.utils.data_misfit <https://pinnicle.readthedocs.io/en/latest/_modules/pinnicle/utils/data_misfit.html#get>``_. These lists include most commonly used loss functions, such as ``"mean"``, ``"MAE"``, ``"MSE"``, ``"MAPE"``, ``"zero"``, ``"VEL_LOG"``, ``"MEAN_SQUARE_LOG"``, etc. Before writing your own loss function, refer to these lists, as these functions are optimized with the backends.
- ``weight``: the weight of this loss function.

Finally, add the new `dict` to `hp["additional_loss"]` with the key indicating the variable to which this loss function should be applied. In the above example, we are adding the mean absolute percentage error of the velocity magnitude to the total loss.
Finally, add the new ``dict`` to ``hp["additional_loss"]`` with the key indicating the variable to which this loss function should be applied. In the above example, we are adding the mean absolute percentage error of the velocity magnitude to the total loss.

Dummy Equations
---------------

PINNICLE provides `Dummy <https://pinnicle.readthedocs.io/en/latest/api/pinnicle.physics.html#module-pinnicle.physics.dummy>`_ physics, which allows you to train the neural network using data only. Here is an example:
PINNICLE provides ``Dummy <https://pinnicle.readthedocs.io/en/latest/api/pinnicle.physics.html#module-pinnicle.physics.dummy>``_ physics, which allows you to train the neural network using data only. Here is an example:
.. code-block:: python
dummy = {}
dummy["output"] = ['u', 's', 'C']
hp["equations"] = {"DUMMY": dummy}
In this example, we define a `dict` with a key `output`, where the value is a list of three output variables. Then, we add this `dict` to `hp['equations']` with the key `DUMMY` (all uppercase). Additionally, you need to provide the data for `u`, `s`, and `C` in the `data` section, similar to other examples. The neural network will then be trained solely with the provided data.
In this example, we define a ``dict`` with a key ``output``, where the value is a list of three output variables. Then, we add this ``dict`` to ``hp['equations']`` with the key ``DUMMY`` (all uppercase). Additionally, you need to provide the data for ``u``, ``s``, and ``C`` in the ``data`` section, similar to other examples. The neural network will then be trained solely with the provided data.

By default, the `Dummy` physics already has `x` and `y` as `input`. If there is no need to change this, only the `output` needs to be defined.
By default, the ``Dummy`` physics already has ``x`` and ``y`` as ``input``. If there is no need to change this, only the ``output`` needs to be defined.


Architecture of the Neural Network
----------------------------------

PINNICLE supports both fully connected neural networks and parallel neural networks. To choose one, simply set `hp["is_parallel"]` to `False` or `True`. Currently, PINNICLE only supports parallel networks for each individual output, and all these networks are of the same size.
PINNICLE supports both fully connected neural networks and parallel neural networks. To choose one, simply set ``hp["is_parallel"]`` to ``False`` or ``True``. Currently, PINNICLE only supports parallel networks for each individual output, and all these networks are of the same size.

Another feature of the neural network architecture is that you can set the number of neurons and layers as follows:

Expand Down
4 changes: 2 additions & 2 deletions docs/pinnicle_examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ Basic
:maxdepth: 1

examples/ssa
examples/mc
examples/couple
.. examples/mc
.. examples/couple
Advanced
--------
Expand Down

0 comments on commit 098aa00

Please sign in to comment.