Skip to content

Commit

Permalink
add load setting and weights
Browse files Browse the repository at this point in the history
  • Loading branch information
enigne committed Jun 26, 2024
1 parent 4cad545 commit 2341c36
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 3 deletions.
35 changes: 33 additions & 2 deletions docs/examples/advanced.rst → docs/advanced.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,39 @@
Advanced Features in PINNICLE
=============================
Advanced Features
=================

PINNICLE is under active development, and several **advanced**/**experimental** features are listed here in alphabetical order:

Load Settings from Previous Experiment
--------------------------------------

Each PINNICLE experiment will save the entire settings to the folder defined in ``hp["save_path"]`` if ``hp["is_save"]=True``. The settings are saved into a ``params.json`` file containing all the non-default settings from ``hp``.

To repeat a new experiment with the same settings as in some ``folder_path``, you can easily load the settings by:

.. code-block:: python
experiment = pinnicle.PINN(loadFrom=folder_path)
However, if you want to run the experiment and save the results in a new folder, you will need to set the ``"save_path"`` and update the experiment:

.. code-block:: python
experiment.update_parameters({"save_path": new_folder})
Then, compile and train the model.

Load Weights from Previously Trained Neural Network
---------------------------------------------------

PINNICLE can also load the weights from a previous experiment. You can either load the settings from a saved experiment or set up a completely new one. After that, you can load the weights of the neural network from the ``folder_path`` which contains the entire experiment (including ``params.json``, a folder called ``pinn``, and some figures).

.. code-block:: python
experiment.load_model(path=folder_path)
After loading the weights, compiling and training are the same as for other experiments.


Additional Loss Functions
-------------------------

Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ User guide
:maxdepth: 1

data
advanced
pinnicle_examples


Expand Down
2 changes: 1 addition & 1 deletion docs/pinnicle_examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ Advanced
.. toctree::
:maxdepth: 2

examples/advanced
.. examples/advanced

0 comments on commit 2341c36

Please sign in to comment.