-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
94 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
Advanced Features in PINNICLE | ||
============================= | ||
|
||
PINNICLE is under active development, and several **advanced**/**experimental** features are listed here in alphabetical order: | ||
|
||
Additional Loss Functions | ||
------------------------- | ||
|
||
It is possible to add additional loss functions to the total loss. Here is an example: | ||
|
||
.. code-block:: python | ||
vel_loss = {} | ||
vel_loss['name'] = "vel MAPE" | ||
vel_loss['function'] = "MAPE" | ||
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. | ||
|
||
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: | ||
|
||
.. 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. | ||
|
||
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. | ||
|
||
Another feature of the neural network architecture is that you can set the number of neurons and layers as follows: | ||
|
||
.. code-block:: python | ||
hp["num_neurons"] = 20 | ||
hp["num_layers"] = 4 | ||
This configuration creates a network with 4 layers, each containing 20 neurons. Alternatively, you can define the number of neurons in each layer using a list: | ||
|
||
.. code-block:: python | ||
hp["num_neurons"] = [128, 64, 32, 16] | ||
In this case, the number of layers is inferred from the length of the list, creating a network with 4 layers having 128, 64, 32, and 16 neurons respectively. | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,7 +47,7 @@ User guide | |
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
pinn_examples | ||
pinnicle_examples | ||
|
||
|
||
API reference | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Examples | ||
======== | ||
|
||
Here are some examples of solving ice sheet modeling problems using PINNICLE | ||
|
||
Basic | ||
----- | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
examples/ssa | ||
examples/mc | ||
examples/couple | ||
|
||
Advanced | ||
-------- | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
examples/advanced | ||
|