From 97f1bdaa1229a50942b59347a88a2fdf770e230b Mon Sep 17 00:00:00 2001 From: Samuel Burbulla Date: Wed, 10 Apr 2024 17:06:25 +0200 Subject: [PATCH] Rename continuity to continuiti. --- CONTRIBUTING.md | 4 ++-- README.md | 22 +++++++++---------- benchmarks/flame/run_flame.py | 6 ++--- benchmarks/html/table.html | 20 ++++++++--------- benchmarks/navierstokes/plot_navierstokes.py | 4 ++-- benchmarks/navierstokes/run_navierstokes.py | 6 ++--- benchmarks/process.py | 2 +- benchmarks/run_all.py | 6 ++--- benchmarks/run_optuna.py | 6 ++--- benchmarks/run_single.py | 6 ++--- docs/benchmarks/index.md | 4 ++-- docs/examples/index.md | 2 +- docs/getting-started/first-steps.md | 4 ++-- docs/getting-started/installation.md | 12 +++++----- docs/index.md | 10 ++++----- docs/operators/architectures.md | 14 ++++++------ docs/operators/index.md | 6 ++--- examples/fno.ipynb | 12 +++++----- examples/functions.ipynb | 18 +++++++-------- examples/meshes.ipynb | 22 +++++++++---------- examples/physicsinformed.ipynb | 8 +++---- examples/selfsupervised.ipynb | 8 +++---- examples/superresolution.ipynb | 12 +++++----- examples/timeseries.ipynb | 6 ++--- examples/training.ipynb | 22 +++++++++---------- mkdocs.yml | 16 +++++++------- pyproject.toml | 10 ++++----- src/{continuity => continuiti}/__init__.py | 2 +- .../benchmarks/__init__.py | 2 +- .../benchmarks/benchmark.py | 6 ++--- .../benchmarks/flame.py | 14 ++++++------ .../benchmarks/navierstokes.py | 14 ++++++------ .../benchmarks/run/__init__.py | 4 ++-- .../benchmarks/run/run_config.py | 6 ++--- .../benchmarks/run/runner.py | 8 +++---- .../benchmarks/run/table.py | 6 ++--- .../benchmarks/sine.py | 14 ++++++------ .../data/__init__.py | 4 ++-- .../data/dataset.py | 6 ++--- .../data/function/__init__.py | 2 +- .../data/function/function.py | 2 +- .../data/function/function_dataset.py | 6 ++--- .../data/function/function_set.py | 12 +++++----- src/{continuity => continuiti}/data/mesh.py | 2 +- .../data/selfsupervised.py | 2 +- .../data/utility.py | 4 ++-- .../discrete/__init__.py | 2 +- .../discrete/box_sampler.py | 2 +- .../discrete/regular_grid.py | 2 +- .../discrete/sampler.py | 2 +- .../discrete/uniform.py | 2 +- .../operators/__init__.py | 4 ++-- .../operators/belnet.py | 10 ++++----- .../operators/cnn.py | 6 ++--- .../operators/common.py | 4 ++-- .../operators/deeponet.py | 8 +++---- .../operators/dno.py | 8 +++---- .../operators/fno.py | 8 +++---- .../operators/fourierlayer.py | 6 ++--- .../operators/integralkernel.py | 10 ++++----- .../operators/losses.py | 6 ++--- .../operators/neuraloperator.py | 6 ++--- .../operators/operator.py | 6 ++--- .../operators/shape.py | 2 +- .../pde/__init__.py | 4 ++-- src/{continuity => continuiti}/pde/grad.py | 8 +++---- .../pde/physicsinformed.py | 6 ++--- .../trainer/__init__.py | 2 +- .../trainer/callbacks.py | 6 ++--- .../trainer/criterion.py | 4 ++-- .../trainer/device.py | 2 +- .../trainer/logs.py | 4 ++-- .../trainer/scheduler.py | 6 ++--- .../trainer/trainer.py | 14 ++++++------ .../transforms/__init__.py | 4 ++-- .../transforms/compose.py | 2 +- .../transforms/quantile_scaler.py | 4 ++-- .../transforms/scaling.py | 2 +- .../transforms/transform.py | 2 +- tests/benchmarks/run/test_runner.py | 6 ++--- tests/benchmarks/test_benchmark.py | 6 ++--- tests/benchmarks/test_navierstokes.py | 4 ++-- tests/benchmarks/test_sine.py | 6 ++--- tests/data/function/test_function.py | 2 +- tests/data/function/test_function_dataset.py | 4 ++-- tests/data/function/test_function_set.py | 2 +- tests/data/test_dataset.py | 2 +- tests/discrete/test_box.py | 2 +- tests/discrete/test_regular_grid.py | 2 +- tests/discrete/test_uniform.py | 2 +- tests/operators/fixtures.py | 2 +- tests/operators/test_belnet.py | 10 ++++----- tests/operators/test_cnn.py | 8 +++---- tests/operators/test_deeponet.py | 10 ++++----- tests/operators/test_dno.py | 8 +++---- tests/operators/test_fno.py | 8 +++---- tests/operators/test_fourierlayer.py | 8 +++---- tests/operators/test_integralkernel.py | 6 ++--- tests/operators/test_neuraloperator.py | 12 +++++----- tests/operators/util.py | 6 ++--- tests/pde/test_grad.py | 2 +- tests/trainer/test_trainer.py | 10 ++++----- tests/transforms/fixtures.py | 2 +- tests/transforms/test_compose.py | 2 +- tests/transforms/test_quantile_scaler.py | 2 +- tests/transforms/test_scaling.py | 2 +- 106 files changed, 342 insertions(+), 342 deletions(-) rename src/{continuity => continuiti}/__init__.py (100%) rename src/{continuity => continuiti}/benchmarks/__init__.py (91%) rename src/{continuity => continuiti}/benchmarks/benchmark.py (85%) rename src/{continuity => continuiti}/benchmarks/flame.py (95%) rename src/{continuity => continuiti}/benchmarks/navierstokes.py (91%) rename src/{continuity => continuiti}/benchmarks/run/__init__.py (55%) rename src/{continuity => continuiti}/benchmarks/run/run_config.py (85%) rename src/{continuity => continuiti}/benchmarks/run/runner.py (94%) rename src/{continuity => continuiti}/benchmarks/run/table.py (97%) rename src/{continuity => continuiti}/benchmarks/sine.py (91%) rename src/{continuity => continuiti}/data/__init__.py (92%) rename src/{continuity => continuiti}/data/dataset.py (98%) rename src/{continuity => continuiti}/data/function/__init__.py (89%) rename src/{continuity => continuiti}/data/function/function.py (98%) rename src/{continuity => continuiti}/data/function/function_dataset.py (97%) rename src/{continuity => continuiti}/data/function/function_set.py (84%) rename src/{continuity => continuiti}/data/mesh.py (98%) rename src/{continuity => continuiti}/data/selfsupervised.py (98%) rename src/{continuity => continuiti}/data/utility.py (94%) rename src/{continuity => continuiti}/discrete/__init__.py (90%) rename src/{continuity => continuiti}/discrete/box_sampler.py (97%) rename src/{continuity => continuiti}/discrete/regular_grid.py (99%) rename src/{continuity => continuiti}/discrete/sampler.py (96%) rename src/{continuity => continuiti}/discrete/uniform.py (96%) rename src/{continuity => continuiti}/operators/__init__.py (96%) rename src/{continuity => continuiti}/operators/belnet.py (95%) rename src/{continuity => continuiti}/operators/cnn.py (96%) rename src/{continuity => continuiti}/operators/common.py (98%) rename src/{continuity => continuiti}/operators/deeponet.py (94%) rename src/{continuity => continuiti}/operators/dno.py (94%) rename src/{continuity => continuiti}/operators/fno.py (88%) rename src/{continuity => continuiti}/operators/fourierlayer.py (99%) rename src/{continuity => continuiti}/operators/integralkernel.py (96%) rename src/{continuity => continuiti}/operators/losses.py (97%) rename src/{continuity => continuiti}/operators/neuraloperator.py (96%) rename src/{continuity => continuiti}/operators/operator.py (95%) rename src/{continuity => continuiti}/operators/shape.py (95%) rename src/{continuity => continuiti}/pde/__init__.py (94%) rename src/{continuity => continuiti}/pde/grad.py (97%) rename src/{continuity => continuiti}/pde/physicsinformed.py (96%) rename src/{continuity => continuiti}/trainer/__init__.py (81%) rename src/{continuity => continuiti}/trainer/callbacks.py (98%) rename src/{continuity => continuiti}/trainer/criterion.py (98%) rename src/{continuity => continuiti}/trainer/device.py (96%) rename src/{continuity => continuiti}/trainer/logs.py (93%) rename src/{continuity => continuiti}/trainer/scheduler.py (91%) rename src/{continuity => continuiti}/trainer/trainer.py (96%) rename src/{continuity => continuiti}/transforms/__init__.py (91%) rename src/{continuity => continuiti}/transforms/compose.py (97%) rename src/{continuity => continuiti}/transforms/quantile_scaler.py (98%) rename src/{continuity => continuiti}/transforms/scaling.py (97%) rename src/{continuity => continuiti}/transforms/transform.py (97%) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f4dff7bf..1c2e9a34 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Contributing -Continuity aims to be a repository of architectures and benchmarks for +**continuiti** aims to be a repository of architectures and benchmarks for operator learning with neural networks and its applications. Contributions are welcome from anyone in the form of pull requests, @@ -86,7 +86,7 @@ during the test run. Because we want documentation to include the full dataset, we commit notebooks with their outputs running with full datasets to the repo. The notebooks are then added by CI to the section -[Examples](https://aai-institute.github.io/continuity/examples.html) of the +[Examples](https://aai-institute.github.io/continuiti/examples.html) of the documentation. ### Hiding cells in notebooks diff --git a/README.md b/README.md index d284b891..00b7c31c 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,16 @@
-Continuity +continuiti -

Continuity

+

continuiti

Learning function operators with neural networks. [![PyTorch](https://img.shields.io/badge/PyTorch-ee4c2c?logo=pytorch&logoColor=white)](https://pytorch.org/get-started/locally/) -[![Documentation](https://img.shields.io/badge/Documentation-blue)](https://aai-institute.github.io/continuity/) -[![Test](https://github.com/aai-institute/continuity/actions/workflows/test.yml/badge.svg)](https://github.com/aai-institute/continuity/actions/workflows/test.yml) +[![Documentation](https://img.shields.io/badge/Documentation-blue)](https://aai-institute.github.io/continuiti/) +[![Test](https://github.com/aai-institute/continuiti/actions/workflows/test.yml/badge.svg)](https://github.com/aai-institute/continuiti/actions/workflows/test.yml)
-**Continuity** is a Python package for machine learning on function operators. +**continuiti** is a Python package for machine learning on function operators. It implements various neural operator architectures (e.g., DeepONets), physics-informed loss functions to train based on PDEs, and a collection of examples and benchmarks. @@ -18,23 +18,23 @@ examples and benchmarks. ## Installation Clone the repository and install the package using pip. ``` -git clone https://github.com/aai-institute/continuity.git -cd continuity +git clone https://github.com/aai-institute/continuiti.git +cd continuiti pip install -e . ``` ## Usage -Our [Documentation](https://aai-institute.github.io/continuity/) contains a +Our [Documentation](https://aai-institute.github.io/continuiti/) contains a verbose introduction to operator learning, a collection of examples using -Continuity, and a class documentation. +continuiti, and a class documentation. -In general, the operator syntax in Continuity is +In general, the operator syntax in **continuiti** is ```python v = operator(x, u(x), y) ``` mapping a function `u` (evaluated at `x`) to function `v` (evaluated in `y`). For more details, see -[Learning Operators](https://aai-institute.github.io/continuity/operators/index.html). +[Learning Operators](https://aai-institute.github.io/continuiti/operators/index.html). ## Contributing Contributions are welcome from anyone in the form of pull requests, bug reports diff --git a/benchmarks/flame/run_flame.py b/benchmarks/flame/run_flame.py index e777f43b..bfb72adc 100644 --- a/benchmarks/flame/run_flame.py +++ b/benchmarks/flame/run_flame.py @@ -1,7 +1,7 @@ from functools import partial -from continuity.benchmarks.run import BenchmarkRunner, RunConfig -from continuity.benchmarks import Flame -from continuity.operators import ConvolutionalNeuralNetwork +from continuiti.benchmarks.run import BenchmarkRunner, RunConfig +from continuiti.benchmarks import Flame +from continuiti.operators import ConvolutionalNeuralNetwork def run(): diff --git a/benchmarks/html/table.html b/benchmarks/html/table.html index 34c08335..80857fad 100644 --- a/benchmarks/html/table.html +++ b/benchmarks/html/table.html @@ -1,25 +1,25 @@ -

SineRegular

+

SineRegular

- - - - + + + +
OperatorParamsLearning Curveloss/trainloss/test
FourierNeuralOperator
(depth=1, width=4)
3053.43e-153.61e-15
DeepNeuralOperator
(depth=32, width=64)
1332496.95e-077.36e-07
BelNet
(D_1=4, D_2=8, K=8, N_1=16, N_2=16)
77681.77e-051.81e-05
DeepONet
(basis_functions=32, branch_depth=8, branch_width=32, trunk_depth=8, trunk_width=32)
180162.5e-052.57e-05
FourierNeuralOperator
(depth=1, width=4)
3053.43e-153.61e-15
DeepNeuralOperator
(depth=32, width=64)
1332496.95e-077.36e-07
BelNet
(D_1=4, D_2=8, K=8, N_1=16, N_2=16)
77681.77e-051.81e-05
DeepONet
(basis_functions=32, branch_depth=8, branch_width=32, trunk_depth=8, trunk_width=32)
180162.5e-052.57e-05
-

SineUniform

+

SineUniform

- - - - + + + +
OperatorParamsLearning Curveloss/trainloss/test
DeepNeuralOperator
(depth=8, width=64)
334090.0002390.000397
BelNet
(D_1=8, D_2=4, K=16, N_1=16, N_2=8)
115120.0003170.000572
DeepONet
(basis_functions=32, branch_depth=8, branch_width=32, trunk_depth=8, trunk_width=32)
180160.003130.00533
FourierNeuralOperator
(depth=3, width=4)
8890.1990.207
DeepNeuralOperator
(depth=8, width=64)
334090.0002390.000397
BelNet
(D_1=8, D_2=4, K=16, N_1=16, N_2=8)
115120.0003170.000572
DeepONet
(basis_functions=32, branch_depth=8, branch_width=32, trunk_depth=8, trunk_width=32)
180160.003130.00533
FourierNeuralOperator
(depth=3, width=4)
8890.1990.207
diff --git a/benchmarks/navierstokes/plot_navierstokes.py b/benchmarks/navierstokes/plot_navierstokes.py index 5f299f77..cdb6fda9 100644 --- a/benchmarks/navierstokes/plot_navierstokes.py +++ b/benchmarks/navierstokes/plot_navierstokes.py @@ -1,7 +1,7 @@ import torch import matplotlib.pyplot as plt -from continuity.benchmarks import NavierStokes -from continuity.operators import FourierNeuralOperator +from continuiti.benchmarks import NavierStokes +from continuiti.operators import FourierNeuralOperator device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") diff --git a/benchmarks/navierstokes/run_navierstokes.py b/benchmarks/navierstokes/run_navierstokes.py index 5ba6a02f..c0a71791 100644 --- a/benchmarks/navierstokes/run_navierstokes.py +++ b/benchmarks/navierstokes/run_navierstokes.py @@ -1,7 +1,7 @@ from functools import partial -from continuity.benchmarks.run import BenchmarkRunner, RunConfig -from continuity.benchmarks import NavierStokes -from continuity.operators import FourierNeuralOperator +from continuiti.benchmarks.run import BenchmarkRunner, RunConfig +from continuiti.benchmarks import NavierStokes +from continuiti.operators import FourierNeuralOperator config = RunConfig( benchmark_factory=NavierStokes, diff --git a/benchmarks/process.py b/benchmarks/process.py index c132dde1..413cdb52 100644 --- a/benchmarks/process.py +++ b/benchmarks/process.py @@ -1,4 +1,4 @@ -from continuity.benchmarks.run.table import BenchmarkTable +from continuiti.benchmarks.run.table import BenchmarkTable if __name__ == "__main__": diff --git a/benchmarks/run_all.py b/benchmarks/run_all.py index 81c276be..b4fc2633 100644 --- a/benchmarks/run_all.py +++ b/benchmarks/run_all.py @@ -2,9 +2,9 @@ import torch from functools import partial from multiprocessing import Pool -from continuity.benchmarks.run import BenchmarkRunner, RunConfig -from continuity.benchmarks import SineRegular, SineUniform -from continuity.operators import ( +from continuiti.benchmarks.run import BenchmarkRunner, RunConfig +from continuiti.benchmarks import SineRegular, SineUniform +from continuiti.operators import ( DeepONet, BelNet, FourierNeuralOperator, diff --git a/benchmarks/run_optuna.py b/benchmarks/run_optuna.py index 42efb1c1..9d2293ce 100644 --- a/benchmarks/run_optuna.py +++ b/benchmarks/run_optuna.py @@ -1,8 +1,8 @@ import optuna from functools import partial -from continuity.benchmarks.run import BenchmarkRunner, RunConfig -from continuity.benchmarks import SineRegular -from continuity.operators import ( +from continuiti.benchmarks.run import BenchmarkRunner, RunConfig +from continuiti.benchmarks import SineRegular +from continuiti.operators import ( FourierNeuralOperator, ) diff --git a/benchmarks/run_single.py b/benchmarks/run_single.py index ddf93163..682ba5ee 100644 --- a/benchmarks/run_single.py +++ b/benchmarks/run_single.py @@ -1,6 +1,6 @@ -from continuity.benchmarks.run import BenchmarkRunner, RunConfig -from continuity.benchmarks import SineRegular -from continuity.operators import DeepNeuralOperator +from continuiti.benchmarks.run import BenchmarkRunner, RunConfig +from continuiti.benchmarks import SineRegular +from continuiti.operators import DeepNeuralOperator config = RunConfig( benchmark_factory=SineRegular, diff --git a/docs/benchmarks/index.md b/docs/benchmarks/index.md index 008c3f64..bc3413e3 100644 --- a/docs/benchmarks/index.md +++ b/docs/benchmarks/index.md @@ -4,14 +4,14 @@ of different operator architectures on various problems. The benchmarks are implemented in the `benchmarks` directory and we refer to this directory for detailed information on how the benchmarks are run. -## [NavierStokes](../api/continuity/benchmarks/#continuity.benchmarks.NavierStokes) +## [NavierStokes](../api/continuiti/benchmarks/#continuiti.benchmarks.NavierStokes) Reference: _Li, Zongyi, et al. "Fourier neural operator for parametric partial differential equations." arXiv preprint arXiv:2010.08895 (2020)_ _Table 1 ($\nu$ = 1e−5 T=20 N=1000)_ _reported for_ FNO-3D: __0.1893__ (rel. test error) -[FourierNeuralOperator](../api/continuity/operators/#continuity.operators.FourierNeuralOperator): +[FourierNeuralOperator](../api/continuiti/operators/#continuiti.operators.FourierNeuralOperator): 0.0185 (rel. train error) __0.1841__ (rel. test error) diff --git a/docs/examples/index.md b/docs/examples/index.md index 58dcdbb5..d25cbc64 100644 --- a/docs/examples/index.md +++ b/docs/examples/index.md @@ -3,7 +3,7 @@ title: Examples --- This is a collection of notebooks that showcase various applications of -Continuity. +continuiti. ::cards:: cols=2 diff --git a/docs/getting-started/first-steps.md b/docs/getting-started/first-steps.md index e77a0087..e20290ab 100644 --- a/docs/getting-started/first-steps.md +++ b/docs/getting-started/first-steps.md @@ -7,7 +7,7 @@ alias: # First Steps -**Continuity** aims to implement recent advances in learning function operators, +**continuiti** aims to implement recent advances in learning function operators, i.e., mappings of (continuous) functions. If you are not familiar with the concepts of operator learning, the page [[operators]] should introduce the key concepts. @@ -16,7 +16,7 @@ key concepts. If you are familiar with the idea of operator learning (or just want to dive right into code), you can start by browsing our examples illustrating -Continuity's capabilities, either: +continuiti's capabilities, either: - On the documentation page under Examples. - Locally, by starting a jupyter server and navigating to the `examples` directory. diff --git a/docs/getting-started/installation.md b/docs/getting-started/installation.md index 438dbf63..06b898be 100644 --- a/docs/getting-started/installation.md +++ b/docs/getting-started/installation.md @@ -1,20 +1,20 @@ --- -title: Installing Continuity +title: Installing continuiti alias: name: installation - text: Installing Continuity + text: Installing continuiti --- -# Installing Continuity +# Installing continuiti To install the latest development version use: ``` -git clone https://github.com/aai-institute/continuity.git -cd continuity +git clone https://github.com/aai-institute/continuiti.git +cd continuiti pip install -e . ``` ## Dependencies -Continuity requires Python>=3.9 and is built on top of +**continuiti** requires Python>=3.9 and is built on top of [PyTorch](https://pytorch.org/). diff --git a/docs/index.md b/docs/index.md index 86a7ebec..ec113db8 100644 --- a/docs/index.md +++ b/docs/index.md @@ -4,16 +4,16 @@ title: Home
-Continuity +continuiti -

Continuity

+

continuiti

Learning function operators with neural networks.
-**Continuity** is a Python package for machine learning on function operators. +**continuiti** is a Python package for machine learning on function operators. It implements various neural operator architectures (e.g., DeepONets), physics-informed loss functions to train based on PDEs, and a collection of examples and benchmarks. @@ -31,11 +31,11 @@ examples and benchmarks. - title: Examples content: > - Some notebooks using Continuity + Some notebooks using continuiti url: examples/index.md - title: Browse the API content: Full class documentation - url: api/continuity/index.md + url: api/continuiti/index.md ::/cards:: diff --git a/docs/operators/architectures.md b/docs/operators/architectures.md index f69edb85..b7066775 100644 --- a/docs/operators/architectures.md +++ b/docs/operators/architectures.md @@ -7,14 +7,14 @@ alias: # Architectures -Continuity implements the following neural operator architectures: +**continuiti** implements the following neural operator architectures: -- [DeepONet](../../api/continuity/operators/deeponet/) -- [Fourier Neural Operator (FNO)](../../api/continuity/operators/fno/) -- [BelNet](../../api/continuity/operators/belnet/) +- [DeepONet](../../api/continuiti/operators/deeponet/) +- [Fourier Neural Operator (FNO)](../../api/continuiti/operators/fno/) +- [BelNet](../../api/continuiti/operators/belnet/) -- [Deep Neural Operator (DNO)](../../api/continuity/operators/dno/) -- [Convolutional Neural Network (CNN)](../../api/continuity/operators/cnn/) -- a generic [NeuralOperator](../../api/continuity/operators/neuraloperator/) class +- [Deep Neural Operator (DNO)](../../api/continuiti/operators/dno/) +- [Convolutional Neural Network (CNN)](../../api/continuiti/operators/cnn/) +- a generic [NeuralOperator](../../api/continuiti/operators/neuraloperator/) class and more to come... diff --git a/docs/operators/index.md b/docs/operators/index.md index f5dff410..8fbda501 100644 --- a/docs/operators/index.md +++ b/docs/operators/index.md @@ -55,7 +55,7 @@ We generally refer to such a neural network $G_\theta$ as a *neural operator*. ## Discretization -In Continuity, we use the general approach of mapping function +In continuiti, we use the general approach of mapping function evaluations to represent both input and output functions $u$ and $v$ in a discretized form. @@ -100,6 +100,6 @@ applications to physics-informed training, super-resolution, and more. See our Examples section for more on this. ## Further Reading -Follow our introduction to Functions in Continuity +Follow our introduction to Functions in continuiti and proceed with the Training example to learn -more about operator learning in Continuity. +more about operator learning in continuiti. diff --git a/examples/fno.ipynb b/examples/fno.ipynb index 16232e8f..191268ef 100644 --- a/examples/fno.ipynb +++ b/examples/fno.ipynb @@ -7,7 +7,7 @@ "# Fourier Neural Operator (FNO)\n", "\n", "This example demonstrates the use of `FourierLayer` and and\n", - "`FourierNeuralOperator` in Continuity.\n", + "`FourierNeuralOperator` in continuiti.\n", "\n", "The FNO architecture was proposed in\n", "[Z. Li et al., 2020](https://arxiv.org/abs/2010.08895) and gained a lot of\n", @@ -45,11 +45,11 @@ "outputs": [], "source": [ "import torch\n", - "from continuity.data import OperatorDataset\n", - "from continuity.discrete import RegularGridSampler\n", - "from continuity.operators import FourierNeuralOperator\n", - "from continuity.operators.fourierlayer import FourierLayer\n", - "from continuity.trainer import Trainer" + "from continuiti.data import OperatorDataset\n", + "from continuiti.discrete import RegularGridSampler\n", + "from continuiti.operators import FourierNeuralOperator\n", + "from continuiti.operators.fourierlayer import FourierLayer\n", + "from continuiti.trainer import Trainer" ] }, { diff --git a/examples/functions.ipynb b/examples/functions.ipynb index ecefb48c..e7c185e9 100644 --- a/examples/functions.ipynb +++ b/examples/functions.ipynb @@ -20,7 +20,7 @@ "learn mappings between infinite-dimensional function spaces.\n", "\n", "This notebook gives an introduction into functions, function spaces (or function sets),\n", - "and how these concepts are implemented in Continuity.\n" + "and how these concepts are implemented in continuiti.\n" ] }, { @@ -126,7 +126,7 @@ "tags": [] }, "source": [ - "In Continuity, functions are handled by a `Function` object that takes a callable as input.\n", + "In continuiti, functions are handled by a `Function` object that takes a callable as input.\n", "As an example, we define two functions $f$ and $g$: \n", "\n", "$$\n", @@ -152,7 +152,7 @@ }, "outputs": [], "source": [ - "from continuity.data.function import Function\n", + "from continuiti.data.function import Function\n", "\n", "f = Function(lambda x: torch.sin(torch.pi * x))\n", "g = Function(lambda x: x ** 3)" @@ -341,7 +341,7 @@ "$$\n", "y = \\beta \\sin(k\\pi x),\\quad A=[\\beta, k]^\\top\\in\\mathbb{R}^2,\\quad x, y\\in\\mathbb{R}.\n", "$$\n", - "In Continuity, function sets are handled by a `FunctionSet` that takes a nested callable as input.\n", + "In continuiti, function sets are handled by a `FunctionSet` that takes a nested callable as input.\n", "When `FunctionSet` is called with a set of parameters it returns a list of `Function` instances." ] }, @@ -358,7 +358,7 @@ }, "outputs": [], "source": [ - "from continuity.data.function import FunctionSet\n", + "from continuiti.data.function import FunctionSet\n", "\n", "sine_set = FunctionSet(lambda a: Function(lambda x: a[0] * torch.sin(a[1] * torch.pi * x)))\n", "\n", @@ -420,7 +420,7 @@ "source": [ "## Sampler\n", "\n", - "In Continuity, there are samplers to create discrete representations of continuous functions. The following example shows how the `RegularGridSampler` and the `UniformBoxSampler` handle this. Both take two corner points of a $n$-dimensional rectangle as inputs. " + "In continuiti, there are samplers to create discrete representations of continuous functions. The following example shows how the `RegularGridSampler` and the `UniformBoxSampler` handle this. Both take two corner points of a $n$-dimensional rectangle as inputs. " ] }, { @@ -444,7 +444,7 @@ } ], "source": [ - "from continuity.discrete import RegularGridSampler, UniformBoxSampler\n", + "from continuiti.discrete import RegularGridSampler, UniformBoxSampler\n", "\n", "sampler_a = RegularGridSampler([1., 1.], [1.5, 2.5])\n", "sampler_b = UniformBoxSampler([1.75, 1.25], [3., 1.75])\n", @@ -606,7 +606,7 @@ "source": [ "## Function Operator Datasets\n", "\n", - "In Continuity, the concepts of function sets and samplers are combined to form `FunctionOperatorDataset` instances. This class is used to handle scenarios where both the input function set $U$ and the output function set $V$ of an operator $G$ are known. It utilizes samplers to generate samples to generate a training set.\n", + "In continuiti, the concepts of function sets and samplers are combined to form `FunctionOperatorDataset` instances. This class is used to handle scenarios where both the input function set $U$ and the output function set $V$ of an operator $G$ are known. It utilizes samplers to generate samples to generate a training set.\n", "\n", "!!! note\n", "\n", @@ -639,7 +639,7 @@ }, "outputs": [], "source": [ - "from continuity.data.function import FunctionOperatorDataset\n", + "from continuiti.data.function import FunctionOperatorDataset\n", "\n", "u_set = FunctionSet(lambda a: Function(lambda xi: torch.sin(a * xi)))\n", "v_set = FunctionSet(lambda a: Function(lambda xi: a * torch.cos(a * xi)))\n", diff --git a/examples/meshes.ipynb b/examples/meshes.ipynb index 52018863..c5b231ff 100644 --- a/examples/meshes.ipynb +++ b/examples/meshes.ipynb @@ -6,7 +6,7 @@ "source": [ "# Meshes\n", "\n", - "This example demonstrates the use of meshes in Continuity.\n", + "This example demonstrates the use of meshes in continuiti.\n", "\n", "In this example, we will load a `Gmsh` file and train a physics-informed neural\n", "operator." @@ -36,11 +36,11 @@ "import pathlib\n", "import matplotlib.pyplot as plt\n", "from matplotlib.tri import Triangulation\n", - "from continuity.data import OperatorDataset\n", - "from continuity.data.mesh import Gmsh\n", - "from continuity.operators import DeepONet\n", - "from continuity.trainer import Trainer\n", - "from continuity.pde import div, grad, PhysicsInformedLoss" + "from continuiti.data import OperatorDataset\n", + "from continuiti.data.mesh import Gmsh\n", + "from continuiti.operators import DeepONet\n", + "from continuiti.trainer import Trainer\n", + "from continuiti.pde import div, grad, PhysicsInformedLoss" ] }, { @@ -56,10 +56,10 @@ "name": "stdout", "output_type": "stream", "text": [ - "Info : Running '/Users/samuelburbulla/Code/continuity/venv/bin/gmsh -2 /Users/samuelburbulla/code/continuity/examples/../data/meshes/mediterranean.geo' [Gmsh 4.12.2, 1 node, max. 1 thread]\n", + "Info : Running '/Users/samuelburbulla/Code/continuiti/venv/bin/gmsh -2 /Users/samuelburbulla/code/continuiti/examples/../data/meshes/mediterranean.geo' [Gmsh 4.12.2, 1 node, max. 1 thread]\n", "Info : Started on Mon Mar 4 16:34:34 2024\n", - "Info : Reading '/Users/samuelburbulla/code/continuity/examples/../data/meshes/mediterranean.geo'...\n", - "Info : Done reading '/Users/samuelburbulla/code/continuity/examples/../data/meshes/mediterranean.geo'\n" + "Info : Reading '/Users/samuelburbulla/code/continuiti/examples/../data/meshes/mediterranean.geo'...\n", + "Info : Done reading '/Users/samuelburbulla/code/continuiti/examples/../data/meshes/mediterranean.geo'\n" ] }, { @@ -480,8 +480,8 @@ "Info : :-) All edges recovered after 1 iteration\n", "Info : Done meshing 2D (Wall 0.342106s, CPU 0.335368s)\n", "Info : 23486 nodes 38449 elements\n", - "Info : Writing '/Users/samuelburbulla/code/continuity/examples/../data/meshes/mediterranean.msh'...\n", - "Info : Done writing '/Users/samuelburbulla/code/continuity/examples/../data/meshes/mediterranean.msh'\n", + "Info : Writing '/Users/samuelburbulla/code/continuiti/examples/../data/meshes/mediterranean.msh'...\n", + "Info : Done writing '/Users/samuelburbulla/code/continuiti/examples/../data/meshes/mediterranean.msh'\n", "Info : Stopped on Mon Mar 4 16:34:49 2024 (From start: Wall 14.5069s, CPU 15.0979s)\n" ] }, diff --git a/examples/physicsinformed.ipynb b/examples/physicsinformed.ipynb index 6454126f..d1ef6800 100644 --- a/examples/physicsinformed.ipynb +++ b/examples/physicsinformed.ipynb @@ -34,10 +34,10 @@ "source": [ "import torch\n", "import matplotlib.pyplot as plt\n", - "from continuity.operators import DeepONet\n", - "from continuity.pde import Grad, PhysicsInformedLoss\n", - "from continuity.data import OperatorDataset\n", - "from continuity.trainer import Trainer" + "from continuiti.operators import DeepONet\n", + "from continuiti.pde import Grad, PhysicsInformedLoss\n", + "from continuiti.data import OperatorDataset\n", + "from continuiti.trainer import Trainer" ] }, { diff --git a/examples/selfsupervised.ipynb b/examples/selfsupervised.ipynb index ace6a6e9..1b55a8c7 100644 --- a/examples/selfsupervised.ipynb +++ b/examples/selfsupervised.ipynb @@ -30,10 +30,10 @@ "source": [ "import torch\n", "import matplotlib.pyplot as plt\n", - "from continuity.benchmarks.sine import SineBenchmark\n", - "from continuity.data.selfsupervised import SelfSupervisedOperatorDataset\n", - "from continuity.operators.integralkernel import NaiveIntegralKernel, NeuralNetworkKernel\n", - "from continuity.trainer import Trainer" + "from continuiti.benchmarks.sine import SineBenchmark\n", + "from continuiti.data.selfsupervised import SelfSupervisedOperatorDataset\n", + "from continuiti.operators.integralkernel import NaiveIntegralKernel, NeuralNetworkKernel\n", + "from continuiti.trainer import Trainer" ] }, { diff --git a/examples/superresolution.ipynb b/examples/superresolution.ipynb index 02c5d68b..4de52459 100644 --- a/examples/superresolution.ipynb +++ b/examples/superresolution.ipynb @@ -54,10 +54,10 @@ "import torch\n", "import pathlib\n", "import matplotlib.pyplot as plt\n", - "from continuity.benchmarks.flame import FlameDataset\n", - "from continuity.operators import DeepONet\n", - "from continuity.trainer import Trainer\n", - "from continuity.trainer.callbacks import PrintTrainingLoss, LearningCurve" + "from continuiti.benchmarks.flame import FlameDataset\n", + "from continuiti.operators import DeepONet\n", + "from continuiti.trainer import Trainer\n", + "from continuiti.trainer.callbacks import LearningCurve" ] }, { @@ -86,7 +86,7 @@ "source": [ "## Flame Dataset\n", "\n", - "Continuity provides the `Flame` class (a special `OperatorDataset`) that reads\n", + "**continuiti** provides the `Flame` class (a special `OperatorDataset`) that reads\n", "and exports samples from the FLAME data. The data set contains train/val splits\n", "and has four channels `ux`, `uy`, `uz`, and `rho`. In this example,\n", "we only use channel `ux` from the first four samples of the val split,\n", @@ -123,7 +123,7 @@ "outputs": [], "source": [ "# Fallback if flame data is not available (e.g. in CI)\n", - "from continuity.operators.shape import OperatorShapes, TensorShape\n", + "from continuiti.operators.shape import OperatorShapes, TensorShape\n", "\n", "flame_dir = pathlib.Path.cwd().joinpath(\"..\", \"data\", \"flame\")\n", "if not flame_dir.joinpath(\"flowfields\").is_dir():\n", diff --git a/examples/timeseries.ipynb b/examples/timeseries.ipynb index e5435267..1098cc12 100644 --- a/examples/timeseries.ipynb +++ b/examples/timeseries.ipynb @@ -88,9 +88,9 @@ "source": [ "import torch\n", "import matplotlib.pyplot as plt\n", - "from continuity.operators import BelNet\n", - "from continuity.data import OperatorDataset\n", - "from continuity.trainer import Trainer" + "from continuiti.operators import BelNet\n", + "from continuiti.data import OperatorDataset\n", + "from continuiti.trainer import Trainer" ] }, { diff --git a/examples/training.ipynb b/examples/training.ipynb index 4aab4b19..26d00f8b 100644 --- a/examples/training.ipynb +++ b/examples/training.ipynb @@ -6,7 +6,7 @@ "source": [ "# Training\n", "\n", - "This example demonstrates the basics of training a neural operator in Continuity." + "This example demonstrates the basics of training a neural operator in continuiti." ] }, { @@ -73,8 +73,8 @@ ], "source": [ "import torch\n", - "from continuity.discrete import RegularGridSampler\n", - "from continuity.data.function import FunctionSet\n", + "from continuiti.discrete import RegularGridSampler\n", + "from continuiti.data.function import FunctionSet\n", "\n", "U = FunctionSet(lambda a: lambda x: torch.sin(a * torch.pi * x))\n", "V = FunctionSet(lambda a: lambda y: a * torch.pi * torch.cos(a * torch.pi * y))\n", @@ -139,7 +139,7 @@ "## Discretization\n", "Operator learning is about learning mappings between infinite dimensional spaces.\n", "To work with infinite-dimensional objects numerically, we have to discretize\n", - "the input and output function somehow. In Continuity, this is done by point-wise\n", + "the input and output function somehow. In continuiti, this is done by point-wise\n", "evaluation.\n", "\n", "Discretized functions can be collected in an `OperatorDataset` for\n", @@ -162,7 +162,7 @@ "metadata": {}, "outputs": [], "source": [ - "from continuity.data.function import FunctionOperatorDataset\n", + "from continuiti.data.function import FunctionOperatorDataset\n", "\n", "a_sampler = RegularGridSampler([1.], [2.])\n", "x_sampler = RegularGridSampler([0.], [1.])\n", @@ -211,7 +211,7 @@ "metadata": {}, "outputs": [], "source": [ - "from continuity.data.utility import split\n", + "from continuiti.data.utility import split\n", "\n", "train_dataset, test_val_dataset = split(dataset, 0.75)\n", "val_dataset, test_dataset = split(test_val_dataset, 0.5)" @@ -268,7 +268,7 @@ }, "outputs": [], "source": [ - "from continuity.operators import DeepONet\n", + "from continuiti.operators import DeepONet\n", "operator = DeepONet(shapes=dataset.shapes, trunk_depth=8)" ] }, @@ -278,7 +278,7 @@ "source": [ "## Training\n", "\n", - "Continuity provides the `Trainer` class\n", + "**continuiti** provides the `Trainer` class\n", "which implements a default training loop for neural operators.\n", "It is instantiated with an `Operator`, an optimizer (`Adam(lr=1e-3)` by default), \n", "and a loss function (`MSELoss` by default).\n", @@ -330,8 +330,8 @@ } ], "source": [ - "from continuity.trainer import Trainer\n", - "from continuity.trainer.callbacks import LearningCurve\n", + "from continuiti.trainer import Trainer\n", + "from continuiti.trainer.callbacks import LearningCurve\n", "\n", "trainer = Trainer(operator)\n", "trainer.fit(\n", @@ -414,7 +414,7 @@ "metadata": {}, "outputs": [], "source": [ - "from continuity.data import dataset_loss\n", + "from continuiti.data import dataset_loss\n", "\n", "loss_train = dataset_loss(train_dataset, operator)\n", "loss_val = dataset_loss(val_dataset, operator)\n", diff --git a/mkdocs.yml b/mkdocs.yml index add511d5..4c378678 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,13 +1,13 @@ -site_name: "Continuity" +site_name: "continuiti" site_dir: "docs_build" -site_url: "https://aai-institute.github.io/continuity/" -repo_name: "aai-institute/continuity" -repo_url: "https://github.com/aai-institute/continuity" +site_url: "https://aai-institute.github.io/continuiti/" +repo_name: "aai-institute/continuiti" +repo_url: "https://github.com/aai-institute/continuiti" copyright: "Copyright © appliedAI Institute for Europe gGmbH" remote_branch: gh-pages watch: - - src/continuity + - src/continuiti - examples hooks: @@ -134,9 +134,9 @@ extra: default: stable social: - icon: fontawesome/brands/github - link: https://github.com/aai-institute/continuity + link: https://github.com/aai-institute/continuiti # - icon: fontawesome/brands/python - # link: https://pypi.org/project/continuity/ + # link: https://pypi.org/project/continuiti/ - icon: fontawesome/brands/twitter link: https://twitter.com/appliedAI_gGmbH - icon: fontawesome/brands/linkedin @@ -188,6 +188,6 @@ nav: - Self-supervised: examples/selfsupervised.ipynb - Benchmarks: benchmarks/index.md - Code: - - API: api/continuity/ + - API: api/continuiti/ - Changelog: CHANGELOG.md - Contributing: CONTRIBUTING.md diff --git a/pyproject.toml b/pyproject.toml index dd35e401..bda68028 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = ["setuptools>=46.1.0", "setuptools_scm[toml]>=5", "wheel"] build-backend = "setuptools.build_meta" [project] -name = "continuity" +name = "continuiti" description = "Learning function operators with neural networks." authors = [{ name = "Samuel Burbulla", email = "s.burbulla@appliedai-institute.de" }] license = { file = "LICENSE.txt" } @@ -88,15 +88,15 @@ benchmark = [ ] [tool.setuptools.dynamic] -version = {attr = "continuity.__version__"} +version = {attr = "continuiti.__version__"} [tool.setuptools.packages.find] where = ["src"] -include = ["continuity"] +include = ["continuiti"] [project.urls] -Repository = "https://github.com/aai-institute/continuity.git" -Documentation = "https://aai-institute.github.io/continuity/" +Repository = "https://github.com/aai-institute/continuiti.git" +Documentation = "https://aai-institute.github.io/continuiti/" Organization = "https://www.appliedai-institute.de/en/" TransferLab = "https://transferlab.ai/" diff --git a/src/continuity/__init__.py b/src/continuiti/__init__.py similarity index 100% rename from src/continuity/__init__.py rename to src/continuiti/__init__.py index 9f9b8b53..3d390b10 100644 --- a/src/continuity/__init__.py +++ b/src/continuiti/__init__.py @@ -1,5 +1,5 @@ """ -**Continuity** is a Python package for machine learning on function operators. +**continuiti** is a Python package for machine learning on function operators. The package is structured into the following modules: diff --git a/src/continuity/benchmarks/__init__.py b/src/continuiti/benchmarks/__init__.py similarity index 91% rename from src/continuity/benchmarks/__init__.py rename to src/continuiti/benchmarks/__init__.py index 69809e30..8cb13c68 100644 --- a/src/continuity/benchmarks/__init__.py +++ b/src/continuiti/benchmarks/__init__.py @@ -1,5 +1,5 @@ """ -`continuity.benchmarks` +`continuiti.benchmarks` Benchmarks for operator learning. """ diff --git a/src/continuity/benchmarks/benchmark.py b/src/continuiti/benchmarks/benchmark.py similarity index 85% rename from src/continuity/benchmarks/benchmark.py rename to src/continuiti/benchmarks/benchmark.py index 4a7e8c97..1cd428bd 100644 --- a/src/continuity/benchmarks/benchmark.py +++ b/src/continuiti/benchmarks/benchmark.py @@ -1,13 +1,13 @@ """ -`continuity.benchmarks.benchmark` +`continuiti.benchmarks.benchmark` Benchmark base class. """ from typing import List from dataclasses import dataclass, field -from continuity.data import OperatorDataset -from continuity.operators.losses import Loss, MSELoss +from continuiti.data import OperatorDataset +from continuiti.operators.losses import Loss, MSELoss @dataclass diff --git a/src/continuity/benchmarks/flame.py b/src/continuiti/benchmarks/flame.py similarity index 95% rename from src/continuity/benchmarks/flame.py rename to src/continuiti/benchmarks/flame.py index 2e91d32b..5add625f 100644 --- a/src/continuity/benchmarks/flame.py +++ b/src/continuiti/benchmarks/flame.py @@ -1,5 +1,5 @@ """ -`continuity.benchmarks.flame` +`continuiti.benchmarks.flame` Flame benchmark. """ @@ -9,12 +9,12 @@ import numpy as np import pandas as pd import pathlib -import continuity +import continuiti from typing import List, Tuple, Optional -from continuity.benchmarks import Benchmark -from continuity.operators.losses import MSELoss -from continuity.operators.shape import OperatorShapes, TensorShape -from continuity.data.dataset import OperatorDatasetBase +from continuiti.benchmarks import Benchmark +from continuiti.operators.losses import MSELoss +from continuiti.operators.shape import OperatorShapes, TensorShape +from continuiti.data.dataset import OperatorDatasetBase class Flame(Benchmark): @@ -42,7 +42,7 @@ def __init__( ): if flame_dir is None: # Get root dir relative to this file - root_dir = pathlib.Path(continuity.__file__).parent.parent.parent + root_dir = pathlib.Path(continuiti.__file__).parent.parent.parent flame_dir = root_dir / "data" / "flame" else: flame_dir = pathlib.Path(flame_dir) diff --git a/src/continuity/benchmarks/navierstokes.py b/src/continuiti/benchmarks/navierstokes.py similarity index 91% rename from src/continuity/benchmarks/navierstokes.py rename to src/continuiti/benchmarks/navierstokes.py index 1bf32fc9..66a60e61 100644 --- a/src/continuity/benchmarks/navierstokes.py +++ b/src/continuiti/benchmarks/navierstokes.py @@ -1,5 +1,5 @@ """ -`continuity.benchmarks.navier_stokes` +`continuiti.benchmarks.navier_stokes` Navier-Stokes benchmark. """ @@ -7,11 +7,11 @@ import torch import scipy.io import pathlib -import continuity +import continuiti from typing import Optional -from continuity.benchmarks import Benchmark -from continuity.operators.losses import RelativeL1Error -from continuity.data.dataset import OperatorDataset +from continuiti.benchmarks import Benchmark +from continuiti.operators.losses import RelativeL1Error +from continuiti.data.dataset import OperatorDataset class NavierStokes(Benchmark): @@ -38,7 +38,7 @@ class NavierStokes(Benchmark): steps $(-0.9, -0.8, ..., 0.0)$ and the output function by the vorticity field at the following ten time steps $(0.1, 0.2, ..., 1.0)$. - ![Visualization of first training sample.](/continuity/benchmarks/navierstokes.png) + ![Visualization of first training sample.](/continuiti/benchmarks/navierstokes.png) The datasets have the following shapes: @@ -60,7 +60,7 @@ class NavierStokes(Benchmark): def __init__(self, dir: Optional[str] = None): if dir is None: # Get root dir relative to this file - root_dir = pathlib.Path(continuity.__file__).parent.parent.parent + root_dir = pathlib.Path(continuiti.__file__).parent.parent.parent dir = root_dir / "data" / "navierstokes" else: dir = pathlib.Path(dir) diff --git a/src/continuity/benchmarks/run/__init__.py b/src/continuiti/benchmarks/run/__init__.py similarity index 55% rename from src/continuity/benchmarks/run/__init__.py rename to src/continuiti/benchmarks/run/__init__.py index 006c948d..61ab47c1 100644 --- a/src/continuity/benchmarks/run/__init__.py +++ b/src/continuiti/benchmarks/run/__init__.py @@ -1,7 +1,7 @@ """ -`continuity.benchmarks.run` +`continuiti.benchmarks.run` -This module contains the functionality to run benchmarks in Continuity. +This module contains the functionality to run benchmarks in continuiti. """ from .run_config import RunConfig diff --git a/src/continuity/benchmarks/run/run_config.py b/src/continuiti/benchmarks/run/run_config.py similarity index 85% rename from src/continuity/benchmarks/run/run_config.py rename to src/continuiti/benchmarks/run/run_config.py index 00731fb5..6ecbd300 100644 --- a/src/continuity/benchmarks/run/run_config.py +++ b/src/continuiti/benchmarks/run/run_config.py @@ -2,9 +2,9 @@ from typing import Callable, Union from dataclasses import dataclass -from continuity.benchmarks import Benchmark -from continuity.operators import Operator, OperatorShapes -from continuity.trainer.device import get_device +from continuiti.benchmarks import Benchmark +from continuiti.operators import Operator, OperatorShapes +from continuiti.trainer.device import get_device @dataclass diff --git a/src/continuity/benchmarks/run/runner.py b/src/continuiti/benchmarks/run/runner.py similarity index 94% rename from src/continuity/benchmarks/run/runner.py rename to src/continuiti/benchmarks/run/runner.py index ef3faf34..1a97a480 100644 --- a/src/continuity/benchmarks/run/runner.py +++ b/src/continuiti/benchmarks/run/runner.py @@ -4,10 +4,10 @@ import numpy as np from datetime import datetime from typing import Optional -from continuity.benchmarks.run import RunConfig -from continuity.trainer import Trainer -from continuity.trainer.callbacks import MLFlowLogger -from continuity.trainer.device import get_device +from continuiti.benchmarks.run import RunConfig +from continuiti.trainer import Trainer +from continuiti.trainer.callbacks import MLFlowLogger +from continuiti.trainer.device import get_device class BenchmarkRunner: diff --git a/src/continuity/benchmarks/run/table.py b/src/continuiti/benchmarks/run/table.py similarity index 97% rename from src/continuity/benchmarks/run/table.py rename to src/continuiti/benchmarks/run/table.py index 581044d0..68d8aa42 100644 --- a/src/continuity/benchmarks/run/table.py +++ b/src/continuiti/benchmarks/run/table.py @@ -81,13 +81,13 @@ def write_html(self): benchmarks = sorted(list(by_benchmark_and_operator.keys())) # Path to the API documentation - path = "../api/continuity/" + path = "../api/continuiti/" table = '\n' for bm in benchmarks: benchmark_data = by_benchmark_and_operator[bm] - table += f'

{bm}

\n' + table += f'

{bm}

\n' table += '
\n\n' table += "" @@ -119,7 +119,7 @@ def write_html(self): sorted_keys = sorted(params_dict.keys()) param_str = ", ".join([f"{k}={params_dict[k]}" for k in sorted_keys]) table += ( - f'' diff --git a/src/continuity/benchmarks/sine.py b/src/continuiti/benchmarks/sine.py similarity index 91% rename from src/continuity/benchmarks/sine.py rename to src/continuiti/benchmarks/sine.py index ad8fb398..a157d377 100644 --- a/src/continuity/benchmarks/sine.py +++ b/src/continuiti/benchmarks/sine.py @@ -1,13 +1,13 @@ """ -`continuity.benchmarks.sine` +`continuiti.benchmarks.sine` Sine benchmarks. """ import torch -from continuity.data.function import FunctionOperatorDataset, FunctionSet, Function -from continuity.benchmarks import Benchmark -from continuity.discrete import RegularGridSampler, UniformBoxSampler -from continuity.operators.losses import MSELoss +from continuiti.data.function import FunctionOperatorDataset, FunctionSet, Function +from continuiti.benchmarks import Benchmark +from continuiti.discrete import RegularGridSampler, UniformBoxSampler +from continuiti.operators.losses import MSELoss class SineBenchmark(Benchmark): @@ -83,7 +83,7 @@ class SineRegular(SineBenchmark): - `n_test` is 1024. - `uniform` is `False`. - ![Visualizations of a few samples.](/continuity/benchmarks/SineRegular.svg) + ![Visualizations of a few samples.](/continuiti/benchmarks/SineRegular.svg) """ @@ -109,7 +109,7 @@ class SineUniform(SineBenchmark): - `n_test` is 4096. - `uniform` is `True`. - ![Visualizations of a few samples.](/continuity/benchmarks/SineUniform.svg) + ![Visualizations of a few samples.](/continuiti/benchmarks/SineUniform.svg) """ diff --git a/src/continuity/data/__init__.py b/src/continuiti/data/__init__.py similarity index 92% rename from src/continuity/data/__init__.py rename to src/continuiti/data/__init__.py index 366c76bb..d194c3ce 100644 --- a/src/continuity/data/__init__.py +++ b/src/continuiti/data/__init__.py @@ -1,7 +1,7 @@ """ -`continuity.data` +`continuiti.data` -Data sets in Continuity. +Data sets in continuiti. Every data set is a list of `(x, u, y, v)` tuples. """ diff --git a/src/continuity/data/dataset.py b/src/continuiti/data/dataset.py similarity index 98% rename from src/continuity/data/dataset.py rename to src/continuiti/data/dataset.py index 74c86490..b555be02 100644 --- a/src/continuity/data/dataset.py +++ b/src/continuiti/data/dataset.py @@ -1,7 +1,7 @@ """ -`continuity.data.dataset` +`continuiti.data.dataset` -Data sets in Continuity. +Data sets in continuiti. Every data set is a list of `(x, u, y, v)` tuples. """ @@ -10,7 +10,7 @@ from typing import Tuple from abc import ABC, abstractmethod -from continuity.operators.shape import OperatorShapes, TensorShape +from continuiti.operators.shape import OperatorShapes, TensorShape class OperatorDatasetBase(td.Dataset, ABC): diff --git a/src/continuity/data/function/__init__.py b/src/continuiti/data/function/__init__.py similarity index 89% rename from src/continuity/data/function/__init__.py rename to src/continuiti/data/function/__init__.py index 8e643189..6bbaf5b0 100644 --- a/src/continuity/data/function/__init__.py +++ b/src/continuiti/data/function/__init__.py @@ -1,5 +1,5 @@ """ -`continuity.data.function` +`continuiti.data.function` Function data set implementations. """ diff --git a/src/continuity/data/function/function.py b/src/continuiti/data/function/function.py similarity index 98% rename from src/continuity/data/function/function.py rename to src/continuiti/data/function/function.py index a3a38014..89c1f356 100644 --- a/src/continuity/data/function/function.py +++ b/src/continuiti/data/function/function.py @@ -1,5 +1,5 @@ """ -`continuity.data.function.function` +`continuiti.data.function.function` Function. """ diff --git a/src/continuity/data/function/function_dataset.py b/src/continuiti/data/function/function_dataset.py similarity index 97% rename from src/continuity/data/function/function_dataset.py rename to src/continuiti/data/function/function_dataset.py index dbfee990..fc2e64ec 100644 --- a/src/continuity/data/function/function_dataset.py +++ b/src/continuiti/data/function/function_dataset.py @@ -1,13 +1,13 @@ """ -`continuity.data.function.function_dataset` +`continuiti.data.function.function_dataset` Function data set implementation. """ import torch from typing import Optional, Tuple -from continuity.discrete.sampler import Sampler -from continuity.data import OperatorDataset +from continuiti.discrete.sampler import Sampler +from continuiti.data import OperatorDataset from .function_set import FunctionSet diff --git a/src/continuity/data/function/function_set.py b/src/continuiti/data/function/function_set.py similarity index 84% rename from src/continuity/data/function/function_set.py rename to src/continuiti/data/function/function_set.py index 26058e31..c3dc49b1 100644 --- a/src/continuity/data/function/function_set.py +++ b/src/continuiti/data/function/function_set.py @@ -1,5 +1,5 @@ """ -`continuity.data.function.function_set` +`continuiti.data.function.function_set` Function set. """ @@ -31,11 +31,11 @@ class FunctionSet: ``` Out: ```shell - - - - - + + + + + ``` """ diff --git a/src/continuity/data/mesh.py b/src/continuiti/data/mesh.py similarity index 98% rename from src/continuity/data/mesh.py rename to src/continuiti/data/mesh.py index 266526d2..71c35427 100644 --- a/src/continuity/data/mesh.py +++ b/src/continuiti/data/mesh.py @@ -1,5 +1,5 @@ """ -`continuity.data.mesh` +`continuiti.data.mesh` Mesh file readers. """ diff --git a/src/continuity/data/selfsupervised.py b/src/continuiti/data/selfsupervised.py similarity index 98% rename from src/continuity/data/selfsupervised.py rename to src/continuiti/data/selfsupervised.py index ba265817..d2638c63 100644 --- a/src/continuity/data/selfsupervised.py +++ b/src/continuiti/data/selfsupervised.py @@ -1,5 +1,5 @@ """ -`continuity.data.selfsupervised` +`continuiti.data.selfsupervised` Self-supervised data set. """ diff --git a/src/continuity/data/utility.py b/src/continuiti/data/utility.py similarity index 94% rename from src/continuity/data/utility.py rename to src/continuiti/data/utility.py index 63d8d927..251a2b08 100644 --- a/src/continuity/data/utility.py +++ b/src/continuiti/data/utility.py @@ -1,12 +1,12 @@ """ -`continuity.data.utility` +`continuiti.data.utility` Utility functions for data handling. """ import torch from typing import Optional -from continuity.operators.losses import Loss, MSELoss +from continuiti.operators.losses import Loss, MSELoss def split(dataset, split=0.5, seed=None): diff --git a/src/continuity/discrete/__init__.py b/src/continuiti/discrete/__init__.py similarity index 90% rename from src/continuity/discrete/__init__.py rename to src/continuiti/discrete/__init__.py index 7161e7cb..7ea49e7a 100644 --- a/src/continuity/discrete/__init__.py +++ b/src/continuiti/discrete/__init__.py @@ -1,5 +1,5 @@ """ -`continuity.discrete` +`continuiti.discrete` Functionalities handling discretization of continuous functionals. """ diff --git a/src/continuity/discrete/box_sampler.py b/src/continuiti/discrete/box_sampler.py similarity index 97% rename from src/continuity/discrete/box_sampler.py rename to src/continuiti/discrete/box_sampler.py index 191aa541..0acd567c 100644 --- a/src/continuity/discrete/box_sampler.py +++ b/src/continuiti/discrete/box_sampler.py @@ -1,5 +1,5 @@ """ -`continuity.discrete.box_sampler` +`continuiti.discrete.box_sampler` Abstract base class for sampling from n-dimensional boxes. """ diff --git a/src/continuity/discrete/regular_grid.py b/src/continuiti/discrete/regular_grid.py similarity index 99% rename from src/continuity/discrete/regular_grid.py rename to src/continuiti/discrete/regular_grid.py index 01d534cc..53cc5885 100644 --- a/src/continuity/discrete/regular_grid.py +++ b/src/continuiti/discrete/regular_grid.py @@ -1,5 +1,5 @@ """ -`continuity.discrete.regular_grid` +`continuiti.discrete.regular_grid` Samplers sampling on a regular grid from n-dimensional boxes. """ diff --git a/src/continuity/discrete/sampler.py b/src/continuiti/discrete/sampler.py similarity index 96% rename from src/continuity/discrete/sampler.py rename to src/continuiti/discrete/sampler.py index 6619a29d..89cfabf0 100644 --- a/src/continuity/discrete/sampler.py +++ b/src/continuiti/discrete/sampler.py @@ -1,5 +1,5 @@ """ -`continuity.discrete.sampler` +`continuiti.discrete.sampler` Abstract base class for sampling from domains. """ diff --git a/src/continuity/discrete/uniform.py b/src/continuiti/discrete/uniform.py similarity index 96% rename from src/continuity/discrete/uniform.py rename to src/continuiti/discrete/uniform.py index 3b9cc37a..80747b17 100644 --- a/src/continuity/discrete/uniform.py +++ b/src/continuiti/discrete/uniform.py @@ -1,5 +1,5 @@ """ -`continuity.discrete.uniform` +`continuiti.discrete.uniform` Uniform samplers. """ diff --git a/src/continuity/operators/__init__.py b/src/continuiti/operators/__init__.py similarity index 96% rename from src/continuity/operators/__init__.py rename to src/continuiti/operators/__init__.py index 7b77b607..66989e59 100644 --- a/src/continuity/operators/__init__.py +++ b/src/continuiti/operators/__init__.py @@ -1,7 +1,7 @@ """ -`continuity.operators` +`continuiti.operators` -Operators in Continuity. +Operators in continuiti. Every operator maps collocation points `x`, function values `u`, and evaluation points `y` to evaluations of `v`: diff --git a/src/continuity/operators/belnet.py b/src/continuiti/operators/belnet.py similarity index 95% rename from src/continuity/operators/belnet.py rename to src/continuiti/operators/belnet.py index 97809e05..1a8baebf 100644 --- a/src/continuity/operators/belnet.py +++ b/src/continuiti/operators/belnet.py @@ -1,14 +1,14 @@ """ -`continuity.operators.belnet` +`continuiti.operators.belnet` The BelNet architecture. """ import torch from typing import Optional -from continuity.operators import Operator -from continuity.operators.common import DeepResidualNetwork -from continuity.operators.shape import OperatorShapes +from continuiti.operators import Operator +from continuiti.operators.common import DeepResidualNetwork +from continuiti.operators.shape import OperatorShapes class BelNet(Operator): @@ -22,7 +22,7 @@ class BelNet(Operator): neural operator. Proceedings of the royal society A (2023). **Note:** In the paper, you can use Figure 6 for reference, but we swapped - the notation of `x` and `y` to comply with the convention in Continuity, + the notation of `x` and `y` to comply with the convention in continuiti, where `x` is the collocation points and `y` is the evaluation points. We also replace the single layer projection and construction networks by more expressive deep residual networks. diff --git a/src/continuity/operators/cnn.py b/src/continuiti/operators/cnn.py similarity index 96% rename from src/continuity/operators/cnn.py rename to src/continuiti/operators/cnn.py index 40070e17..0c5913c3 100644 --- a/src/continuity/operators/cnn.py +++ b/src/continuiti/operators/cnn.py @@ -1,13 +1,13 @@ """ -`continuity.operators.cnn` +`continuiti.operators.cnn` The ConvolutionalNeuralNetwork (CNN) architecture. """ import torch from typing import Optional, Tuple -from continuity.operators import Operator -from continuity.operators.shape import OperatorShapes +from continuiti.operators import Operator +from continuiti.operators.shape import OperatorShapes class ConvolutionalNeuralNetwork(Operator): diff --git a/src/continuity/operators/common.py b/src/continuiti/operators/common.py similarity index 98% rename from src/continuity/operators/common.py rename to src/continuiti/operators/common.py index 8dd6200f..36284739 100644 --- a/src/continuity/operators/common.py +++ b/src/continuiti/operators/common.py @@ -1,7 +1,7 @@ """ -`continuity.operators.common` +`continuiti.operators.common` -Common functionality for operators in Continuity. +Common functionality for operators in continuiti. """ import torch diff --git a/src/continuity/operators/deeponet.py b/src/continuiti/operators/deeponet.py similarity index 94% rename from src/continuity/operators/deeponet.py rename to src/continuiti/operators/deeponet.py index a0a8a6dc..45dee21e 100644 --- a/src/continuity/operators/deeponet.py +++ b/src/continuiti/operators/deeponet.py @@ -1,14 +1,14 @@ """ -`continuity.operators.deeponet` +`continuiti.operators.deeponet` The DeepONet architecture. """ import torch from typing import Optional -from continuity.operators import Operator -from continuity.operators.common import DeepResidualNetwork -from continuity.operators.shape import OperatorShapes +from continuiti.operators import Operator +from continuiti.operators.common import DeepResidualNetwork +from continuiti.operators.shape import OperatorShapes class DeepONet(Operator): diff --git a/src/continuity/operators/dno.py b/src/continuiti/operators/dno.py similarity index 94% rename from src/continuity/operators/dno.py rename to src/continuiti/operators/dno.py index 7bb7723e..968c9eb5 100644 --- a/src/continuity/operators/dno.py +++ b/src/continuiti/operators/dno.py @@ -1,14 +1,14 @@ """ -`continuity.operators.dno` +`continuiti.operators.dno` The Deep Neural Operator (DNO) architecture. """ import torch from typing import Optional -from continuity.operators import Operator -from continuity.operators.common import DeepResidualNetwork -from continuity.operators.shape import OperatorShapes +from continuiti.operators import Operator +from continuiti.operators.common import DeepResidualNetwork +from continuiti.operators.shape import OperatorShapes class DeepNeuralOperator(Operator): diff --git a/src/continuity/operators/fno.py b/src/continuiti/operators/fno.py similarity index 88% rename from src/continuity/operators/fno.py rename to src/continuiti/operators/fno.py index c3d0759f..7bceef43 100644 --- a/src/continuity/operators/fno.py +++ b/src/continuiti/operators/fno.py @@ -1,14 +1,14 @@ """ -`continuity.operators.fno` +`continuiti.operators.fno` The Fourier Neural Operator """ import torch from typing import Optional -from continuity.operators import NeuralOperator -from continuity.operators.fourierlayer import FourierLayer -from continuity.operators.shape import OperatorShapes, TensorShape +from continuiti.operators import NeuralOperator +from continuiti.operators.fourierlayer import FourierLayer +from continuiti.operators.shape import OperatorShapes, TensorShape class FourierNeuralOperator(NeuralOperator): diff --git a/src/continuity/operators/fourierlayer.py b/src/continuiti/operators/fourierlayer.py similarity index 99% rename from src/continuity/operators/fourierlayer.py rename to src/continuiti/operators/fourierlayer.py index ec021c72..0a9e7d74 100644 --- a/src/continuity/operators/fourierlayer.py +++ b/src/continuiti/operators/fourierlayer.py @@ -1,5 +1,5 @@ """ -`continuity.operators.fourierlayer` +`continuiti.operators.fourierlayer` The Fourier layer of the Fourier Neural Operator (FNO). """ @@ -9,8 +9,8 @@ import torch.nn as nn from torch.fft import rfft, irfft, rfftn, irfftn from typing import Optional, Tuple, List -from continuity.operators import Operator -from continuity.operators.shape import OperatorShapes +from continuiti.operators import Operator +from continuiti.operators.shape import OperatorShapes class FourierLayer1d(Operator): diff --git a/src/continuity/operators/integralkernel.py b/src/continuiti/operators/integralkernel.py similarity index 96% rename from src/continuity/operators/integralkernel.py rename to src/continuiti/operators/integralkernel.py index 22b283d2..ffd237d5 100644 --- a/src/continuity/operators/integralkernel.py +++ b/src/continuiti/operators/integralkernel.py @@ -1,5 +1,5 @@ """ -`continuity.operators.integralkernel` +`continuiti.operators.integralkernel` Integral kernel operations. """ @@ -7,9 +7,9 @@ import torch from abc import ABC, abstractmethod from typing import Optional -from continuity.operators import Operator -from continuity.operators.common import DeepResidualNetwork -from continuity.operators.shape import OperatorShapes +from continuiti.operators import Operator +from continuiti.operators.common import DeepResidualNetwork +from continuiti.operators.shape import OperatorShapes class Kernel(torch.nn.Module, ABC): @@ -22,7 +22,7 @@ class Kernel(torch.nn.Module, ABC): (x, y) &\mapsto \kappa(x, y). \end{align*} - In Continuity, we add a batch dimension and the number of sensor points for + In continuiti, we add a batch dimension and the number of sensor points for $x$ and $y$ to enable efficient implementation of the kernel, such that the shapes of the input tensors are diff --git a/src/continuity/operators/losses.py b/src/continuiti/operators/losses.py similarity index 97% rename from src/continuity/operators/losses.py rename to src/continuiti/operators/losses.py index 2b284fc0..8400db53 100644 --- a/src/continuity/operators/losses.py +++ b/src/continuiti/operators/losses.py @@ -1,5 +1,5 @@ """ -`continuity.operators.losses` +`continuiti.operators.losses` Loss functions for operator learning. @@ -16,11 +16,11 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - from continuity.operators.operator import Operator + from continuiti.operators.operator import Operator class Loss: - """Loss function for training operators in Continuity.""" + """Loss function for training operators in continuiti.""" @abstractmethod def __call__( diff --git a/src/continuity/operators/neuraloperator.py b/src/continuiti/operators/neuraloperator.py similarity index 96% rename from src/continuity/operators/neuraloperator.py rename to src/continuiti/operators/neuraloperator.py index c23356fa..23ea1e4e 100644 --- a/src/continuity/operators/neuraloperator.py +++ b/src/continuiti/operators/neuraloperator.py @@ -1,5 +1,5 @@ """ -`continuity.operators.neuraloperator` +`continuiti.operators.neuraloperator` Operators can be stacked into a `NeuralOperator` architecture, which is a stack of continuous convolutions with a lifting layer and a projection layer. @@ -7,8 +7,8 @@ import torch from typing import List, Optional -from continuity.operators import Operator -from continuity.operators.shape import OperatorShapes +from continuiti.operators import Operator +from continuiti.operators.shape import OperatorShapes class NeuralOperator(Operator): diff --git a/src/continuity/operators/operator.py b/src/continuiti/operators/operator.py similarity index 95% rename from src/continuity/operators/operator.py rename to src/continuiti/operators/operator.py index 370dd834..4217d155 100644 --- a/src/continuity/operators/operator.py +++ b/src/continuiti/operators/operator.py @@ -1,13 +1,13 @@ """ -`continuity.operators.operator` +`continuiti.operators.operator` -In Continuity, all models for operator learning are based on the `Operator` base class. +In continuiti, all models for operator learning are based on the `Operator` base class. """ import torch from typing import Optional from abc import ABC, abstractmethod -from continuity.operators.shape import OperatorShapes +from continuiti.operators.shape import OperatorShapes class Operator(torch.nn.Module, ABC): diff --git a/src/continuity/operators/shape.py b/src/continuiti/operators/shape.py similarity index 95% rename from src/continuity/operators/shape.py rename to src/continuiti/operators/shape.py index 882dd75f..34305e81 100644 --- a/src/continuity/operators/shape.py +++ b/src/continuiti/operators/shape.py @@ -1,5 +1,5 @@ """ -`continuity.operators.shape` +`continuiti.operators.shape` """ from dataclasses import dataclass diff --git a/src/continuity/pde/__init__.py b/src/continuiti/pde/__init__.py similarity index 94% rename from src/continuity/pde/__init__.py rename to src/continuiti/pde/__init__.py index 066e74af..88d9583d 100644 --- a/src/continuity/pde/__init__.py +++ b/src/continuiti/pde/__init__.py @@ -1,7 +1,7 @@ """ -`continuity.pde` +`continuiti.pde` -This module contains utilities for solving PDEs in Continuity, +This module contains utilities for solving PDEs in continuiti, e.g., physics-informed loss functions. """ diff --git a/src/continuity/pde/grad.py b/src/continuiti/pde/grad.py similarity index 97% rename from src/continuity/pde/grad.py rename to src/continuiti/pde/grad.py index ff66c005..cce99fbb 100644 --- a/src/continuity/pde/grad.py +++ b/src/continuiti/pde/grad.py @@ -1,10 +1,10 @@ """ -`continuity.pde.grad` +`continuiti.pde.grad` -Functional gradients in Continuity. +Functional gradients in continuiti. Derivatives are function operators, so it is natural to define them as operators -within Continuity. +within continuiti. The following gradients define several derivation operators (e.g., grad, div) that simplify the definition of PDEs in physics-informed losses. @@ -13,7 +13,7 @@ import torch from torch import Tensor from typing import Optional, Callable -from continuity.operators.operator import Operator +from continuiti.operators.operator import Operator class Grad(Operator): diff --git a/src/continuity/pde/physicsinformed.py b/src/continuiti/pde/physicsinformed.py similarity index 96% rename from src/continuity/pde/physicsinformed.py rename to src/continuiti/pde/physicsinformed.py index 4d8a1948..8f7b885e 100644 --- a/src/continuity/pde/physicsinformed.py +++ b/src/continuiti/pde/physicsinformed.py @@ -1,5 +1,5 @@ """ -`continuity.pde.physicsinformed` +`continuiti.pde.physicsinformed` PDEs and physics-informed loss functions. """ @@ -7,7 +7,7 @@ import torch from abc import abstractmethod -from continuity.operators.operator import Operator +from continuiti.operators.operator import Operator class PDE: @@ -48,7 +48,7 @@ def __call__( class PhysicsInformedLoss: - """Physics-informed loss function for training operators in Continuity. + """Physics-informed loss function for training operators in continuiti. ```python loss = pde(x, u, y, op(x, u, y)) diff --git a/src/continuity/trainer/__init__.py b/src/continuiti/trainer/__init__.py similarity index 81% rename from src/continuity/trainer/__init__.py rename to src/continuiti/trainer/__init__.py index 370140d9..7e5f1972 100644 --- a/src/continuity/trainer/__init__.py +++ b/src/continuiti/trainer/__init__.py @@ -1,5 +1,5 @@ """ -`continuity.trainer` +`continuiti.trainer` Trainer for operator learning. """ diff --git a/src/continuity/trainer/callbacks.py b/src/continuiti/trainer/callbacks.py similarity index 98% rename from src/continuity/trainer/callbacks.py rename to src/continuiti/trainer/callbacks.py index 7ed5f522..79ae3977 100644 --- a/src/continuity/trainer/callbacks.py +++ b/src/continuiti/trainer/callbacks.py @@ -1,14 +1,14 @@ """ -`continuity.trainer.callbacks` +`continuiti.trainer.callbacks` -Callbacks for Trainer in Continuity. +Callbacks for Trainer in continuiti. """ from typing import Optional, List from time import time import math import matplotlib.pyplot as plt -from continuity.operators import Operator +from continuiti.operators import Operator from .logs import Logs try: diff --git a/src/continuity/trainer/criterion.py b/src/continuiti/trainer/criterion.py similarity index 98% rename from src/continuity/trainer/criterion.py rename to src/continuiti/trainer/criterion.py index 3c69500a..5c8608c2 100644 --- a/src/continuity/trainer/criterion.py +++ b/src/continuiti/trainer/criterion.py @@ -1,7 +1,7 @@ """ -`continuity.trainer.criterion` +`continuiti.trainer.criterion` -Stopping criterion for Trainer in Continuity. +Stopping criterion for Trainer in continuiti. """ from abc import ABC, abstractmethod diff --git a/src/continuity/trainer/device.py b/src/continuiti/trainer/device.py similarity index 96% rename from src/continuity/trainer/device.py rename to src/continuiti/trainer/device.py index 8d7b8b24..b54445a6 100644 --- a/src/continuity/trainer/device.py +++ b/src/continuiti/trainer/device.py @@ -1,5 +1,5 @@ """ -`continuity.trainer.device` +`continuiti.trainer.device` Default torch device. """ diff --git a/src/continuity/trainer/logs.py b/src/continuiti/trainer/logs.py similarity index 93% rename from src/continuity/trainer/logs.py rename to src/continuiti/trainer/logs.py index 37e78c7e..e94dcb29 100644 --- a/src/continuity/trainer/logs.py +++ b/src/continuiti/trainer/logs.py @@ -1,5 +1,5 @@ """ -`continuity.trainer.logs` +`continuiti.trainer.logs` """ from dataclasses import dataclass @@ -8,7 +8,7 @@ @dataclass class Logs: """ - Logs for callbacks and criteria within Trainer in Continuity. + Logs for callbacks and criteria within Trainer in continuiti. Attributes: epoch: Current epoch. diff --git a/src/continuity/trainer/scheduler.py b/src/continuiti/trainer/scheduler.py similarity index 91% rename from src/continuity/trainer/scheduler.py rename to src/continuiti/trainer/scheduler.py index 5bb9aacc..e451e256 100644 --- a/src/continuity/trainer/scheduler.py +++ b/src/continuiti/trainer/scheduler.py @@ -1,11 +1,11 @@ """ -`continuity.trainer.scheduler` +`continuiti.trainer.scheduler` -Learning rate scheduler for Trainer in Continuity. +Learning rate scheduler for Trainer in continuiti. """ import torch -from continuity.trainer.callbacks import Callback +from continuiti.trainer.callbacks import Callback class LinearLRScheduler(Callback): diff --git a/src/continuity/trainer/trainer.py b/src/continuiti/trainer/trainer.py similarity index 96% rename from src/continuity/trainer/trainer.py rename to src/continuiti/trainer/trainer.py index 5cac8fca..acae00f3 100644 --- a/src/continuity/trainer/trainer.py +++ b/src/continuiti/trainer/trainer.py @@ -1,5 +1,5 @@ """ -`continuity.trainer.trainer` +`continuiti.trainer.trainer` """ import math @@ -9,10 +9,10 @@ from torch.utils.data import DataLoader from torch.utils.data.distributed import DistributedSampler from typing import Optional, List, Union -from continuity.data import OperatorDataset -from continuity.operators import Operator -from continuity.operators.losses import Loss, MSELoss -from continuity.trainer.device import get_device +from continuiti.data import OperatorDataset +from continuiti.operators import Operator +from continuiti.operators.losses import Loss, MSELoss +from continuiti.trainer.device import get_device from .callbacks import Callback, PrintTrainingLoss from .scheduler import LinearLRScheduler from .criterion import Criterion, TrainingLossCriterion, TestLossCriterion @@ -24,8 +24,8 @@ class Trainer: Example: ```python - from continuity.trainer import Trainer - from continuity.operators.losses import MSELoss + from continuiti.trainer import Trainer + from continuiti.operators.losses import MSELoss ... optimizer = torch.optim.Adam(operator.parameters(), lr=1e-3) loss_fn = MSELoss() diff --git a/src/continuity/transforms/__init__.py b/src/continuiti/transforms/__init__.py similarity index 91% rename from src/continuity/transforms/__init__.py rename to src/continuiti/transforms/__init__.py index 0688d86f..0ca287fa 100644 --- a/src/continuity/transforms/__init__.py +++ b/src/continuiti/transforms/__init__.py @@ -1,7 +1,7 @@ """ -`continuity.transforms` +`continuiti.transforms` -Data transformations in Continuity. +Data transformations in continuiti. """ from .transform import Transform diff --git a/src/continuity/transforms/compose.py b/src/continuiti/transforms/compose.py similarity index 97% rename from src/continuity/transforms/compose.py rename to src/continuiti/transforms/compose.py index e8a2e014..fda7d080 100644 --- a/src/continuity/transforms/compose.py +++ b/src/continuiti/transforms/compose.py @@ -1,5 +1,5 @@ """ -`continuity.transforms.compose` +`continuiti.transforms.compose` Composes multiple transformations. """ diff --git a/src/continuity/transforms/quantile_scaler.py b/src/continuiti/transforms/quantile_scaler.py similarity index 98% rename from src/continuity/transforms/quantile_scaler.py rename to src/continuiti/transforms/quantile_scaler.py index 60dc397d..b169e457 100644 --- a/src/continuity/transforms/quantile_scaler.py +++ b/src/continuiti/transforms/quantile_scaler.py @@ -1,12 +1,12 @@ """ -`continuity.transforms.quantile_scaler` +`continuiti.transforms.quantile_scaler` Quantile Scaler class. """ import torch import torch.nn as nn -from continuity.transforms import Transform +from continuiti.transforms import Transform from typing import Union, Tuple diff --git a/src/continuity/transforms/scaling.py b/src/continuiti/transforms/scaling.py similarity index 97% rename from src/continuity/transforms/scaling.py rename to src/continuiti/transforms/scaling.py index 4dedec15..91e3e110 100644 --- a/src/continuity/transforms/scaling.py +++ b/src/continuiti/transforms/scaling.py @@ -1,5 +1,5 @@ """ -`continuity.transforms.scaling` +`continuiti.transforms.scaling` """ import torch diff --git a/src/continuity/transforms/transform.py b/src/continuiti/transforms/transform.py similarity index 97% rename from src/continuity/transforms/transform.py rename to src/continuiti/transforms/transform.py index 0e49549d..1174ea42 100644 --- a/src/continuity/transforms/transform.py +++ b/src/continuiti/transforms/transform.py @@ -1,5 +1,5 @@ """ -`continuity.transforms.transform` +`continuiti.transforms.transform` Transform base class. """ diff --git a/tests/benchmarks/run/test_runner.py b/tests/benchmarks/run/test_runner.py index 456c1284..6fbe58aa 100644 --- a/tests/benchmarks/run/test_runner.py +++ b/tests/benchmarks/run/test_runner.py @@ -1,7 +1,7 @@ import pytest -from continuity.benchmarks.run import BenchmarkRunner, RunConfig -from continuity.benchmarks import SineRegular -from continuity.operators import DeepNeuralOperator +from continuiti.benchmarks.run import BenchmarkRunner, RunConfig +from continuiti.benchmarks import SineRegular +from continuiti.operators import DeepNeuralOperator @pytest.mark.slow diff --git a/tests/benchmarks/test_benchmark.py b/tests/benchmarks/test_benchmark.py index ffa291ab..a0325db7 100644 --- a/tests/benchmarks/test_benchmark.py +++ b/tests/benchmarks/test_benchmark.py @@ -1,7 +1,7 @@ import torch -from continuity.benchmarks import Benchmark -from continuity.data import OperatorDataset -from continuity.operators.losses import MSELoss +from continuiti.benchmarks import Benchmark +from continuiti.data import OperatorDataset +from continuiti.operators.losses import MSELoss def test_can_initialize(): diff --git a/tests/benchmarks/test_navierstokes.py b/tests/benchmarks/test_navierstokes.py index 4fd97938..0ea510f3 100644 --- a/tests/benchmarks/test_navierstokes.py +++ b/tests/benchmarks/test_navierstokes.py @@ -1,8 +1,8 @@ import pytest import matplotlib.pyplot as plt from pathlib import Path -from continuity.benchmarks import Benchmark, NavierStokes -from continuity.data import OperatorDataset +from continuiti.benchmarks import Benchmark, NavierStokes +from continuiti.data import OperatorDataset def check_data_exists(): diff --git a/tests/benchmarks/test_sine.py b/tests/benchmarks/test_sine.py index 0aca7abf..505c7105 100644 --- a/tests/benchmarks/test_sine.py +++ b/tests/benchmarks/test_sine.py @@ -1,8 +1,8 @@ import torch -from continuity.benchmarks import Benchmark -from continuity.benchmarks.sine import SineBenchmark -from continuity.data import OperatorDataset +from continuiti.benchmarks import Benchmark +from continuiti.benchmarks.sine import SineBenchmark +from continuiti.data import OperatorDataset def test_return_type_correct(): diff --git a/tests/data/function/test_function.py b/tests/data/function/test_function.py index 898f6ffa..2cd57941 100644 --- a/tests/data/function/test_function.py +++ b/tests/data/function/test_function.py @@ -1,7 +1,7 @@ import pytest import torch from typing import List -from continuity.data.function.function import Function +from continuiti.data.function.function import Function @pytest.fixture(scope="module") diff --git a/tests/data/function/test_function_dataset.py b/tests/data/function/test_function_dataset.py index c794b6f3..2acf83d6 100644 --- a/tests/data/function/test_function_dataset.py +++ b/tests/data/function/test_function_dataset.py @@ -1,7 +1,7 @@ import pytest import torch -from continuity.data.function import FunctionOperatorDataset, FunctionSet -from continuity.discrete import RegularGridSampler +from continuiti.data.function import FunctionOperatorDataset, FunctionSet +from continuiti.discrete import RegularGridSampler @pytest.fixture(scope="module") diff --git a/tests/data/function/test_function_set.py b/tests/data/function/test_function_set.py index bccc3481..ea470ad3 100644 --- a/tests/data/function/test_function_set.py +++ b/tests/data/function/test_function_set.py @@ -1,6 +1,6 @@ import pytest import torch -from continuity.data.function.function_set import FunctionSet, Function +from continuiti.data.function.function_set import FunctionSet, Function @pytest.fixture(scope="module") diff --git a/tests/data/test_dataset.py b/tests/data/test_dataset.py index ddadb052..a589bd3a 100644 --- a/tests/data/test_dataset.py +++ b/tests/data/test_dataset.py @@ -1,6 +1,6 @@ import torch from torch.utils.data import DataLoader -from continuity.data.selfsupervised import SelfSupervisedOperatorDataset +from continuiti.data.selfsupervised import SelfSupervisedOperatorDataset def test_dataset(): diff --git a/tests/discrete/test_box.py b/tests/discrete/test_box.py index 0175cfba..52c3d695 100644 --- a/tests/discrete/test_box.py +++ b/tests/discrete/test_box.py @@ -1,7 +1,7 @@ import pytest import torch -from continuity.discrete.box_sampler import BoxSampler +from continuiti.discrete.box_sampler import BoxSampler @pytest.fixture(scope="module") diff --git a/tests/discrete/test_regular_grid.py b/tests/discrete/test_regular_grid.py index e36789f9..1b711fdf 100644 --- a/tests/discrete/test_regular_grid.py +++ b/tests/discrete/test_regular_grid.py @@ -2,7 +2,7 @@ import torch from typing import List -from continuity.discrete import RegularGridSampler +from continuiti.discrete import RegularGridSampler @pytest.fixture(scope="module") diff --git a/tests/discrete/test_uniform.py b/tests/discrete/test_uniform.py index 0028011a..c8799449 100644 --- a/tests/discrete/test_uniform.py +++ b/tests/discrete/test_uniform.py @@ -2,7 +2,7 @@ import torch from typing import List -from continuity.discrete import UniformBoxSampler +from continuiti.discrete import UniformBoxSampler @pytest.fixture(scope="module") diff --git a/tests/operators/fixtures.py b/tests/operators/fixtures.py index f610ab90..5b6030f2 100644 --- a/tests/operators/fixtures.py +++ b/tests/operators/fixtures.py @@ -2,7 +2,7 @@ import torch from itertools import product from typing import List -from continuity.data import OperatorDataset +from continuiti.data import OperatorDataset @pytest.fixture(scope="session") diff --git a/tests/operators/test_belnet.py b/tests/operators/test_belnet.py index f8eb5eb4..7654ceaa 100644 --- a/tests/operators/test_belnet.py +++ b/tests/operators/test_belnet.py @@ -1,11 +1,11 @@ import torch import pytest -from continuity.operators import BelNet -from continuity.benchmarks.sine import SineBenchmark -from continuity.data import OperatorDataset -from continuity.trainer import Trainer -from continuity.operators.losses import MSELoss +from continuiti.operators import BelNet +from continuiti.benchmarks.sine import SineBenchmark +from continuiti.data import OperatorDataset +from continuiti.trainer import Trainer +from continuiti.operators.losses import MSELoss from .util import get_shape_mismatches diff --git a/tests/operators/test_cnn.py b/tests/operators/test_cnn.py index 971e793b..a731bc7c 100644 --- a/tests/operators/test_cnn.py +++ b/tests/operators/test_cnn.py @@ -1,8 +1,8 @@ import pytest -from continuity.benchmarks.sine import SineBenchmark -from continuity.trainer import Trainer -from continuity.operators import ConvolutionalNeuralNetwork -from continuity.operators.losses import MSELoss +from continuiti.benchmarks.sine import SineBenchmark +from continuiti.trainer import Trainer +from continuiti.operators import ConvolutionalNeuralNetwork +from continuiti.operators.losses import MSELoss @pytest.mark.slow diff --git a/tests/operators/test_deeponet.py b/tests/operators/test_deeponet.py index 5ae8913f..6ebce1f7 100644 --- a/tests/operators/test_deeponet.py +++ b/tests/operators/test_deeponet.py @@ -1,11 +1,11 @@ import torch import pytest -from continuity.operators import DeepONet -from continuity.benchmarks.sine import SineBenchmark -from continuity.data import OperatorDataset -from continuity.trainer import Trainer -from continuity.operators.losses import MSELoss +from continuiti.operators import DeepONet +from continuiti.benchmarks.sine import SineBenchmark +from continuiti.data import OperatorDataset +from continuiti.trainer import Trainer +from continuiti.operators.losses import MSELoss from .util import get_shape_mismatches diff --git a/tests/operators/test_dno.py b/tests/operators/test_dno.py index e3e9713e..7f1484bd 100644 --- a/tests/operators/test_dno.py +++ b/tests/operators/test_dno.py @@ -1,9 +1,9 @@ import pytest from typing import List -from continuity.benchmarks.sine import SineBenchmark -from continuity.trainer import Trainer -from continuity.operators import DeepNeuralOperator -from continuity.operators.losses import MSELoss +from continuiti.benchmarks.sine import SineBenchmark +from continuiti.trainer import Trainer +from continuiti.operators import DeepNeuralOperator +from continuiti.operators.losses import MSELoss from .util import get_shape_mismatches diff --git a/tests/operators/test_fno.py b/tests/operators/test_fno.py index 1003bc02..206f3ff1 100644 --- a/tests/operators/test_fno.py +++ b/tests/operators/test_fno.py @@ -1,8 +1,8 @@ import pytest -from continuity.benchmarks.sine import SineBenchmark -from continuity.trainer import Trainer -from continuity.operators import FourierNeuralOperator -from continuity.operators.losses import MSELoss +from continuiti.benchmarks.sine import SineBenchmark +from continuiti.trainer import Trainer +from continuiti.operators import FourierNeuralOperator +from continuiti.operators.losses import MSELoss @pytest.mark.slow diff --git a/tests/operators/test_fourierlayer.py b/tests/operators/test_fourierlayer.py index 162ea53e..911bd233 100644 --- a/tests/operators/test_fourierlayer.py +++ b/tests/operators/test_fourierlayer.py @@ -1,10 +1,10 @@ import torch import pytest -from continuity.operators.losses import MSELoss -from continuity.trainer import Trainer -from continuity.data import OperatorDataset -from continuity.operators.fourierlayer import FourierLayer1d, FourierLayer +from continuiti.operators.losses import MSELoss +from continuiti.trainer import Trainer +from continuiti.data import OperatorDataset +from continuiti.operators.fourierlayer import FourierLayer1d, FourierLayer torch.manual_seed(0) device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") diff --git a/tests/operators/test_integralkernel.py b/tests/operators/test_integralkernel.py index 786f9dfe..e9d3945c 100644 --- a/tests/operators/test_integralkernel.py +++ b/tests/operators/test_integralkernel.py @@ -1,9 +1,9 @@ import pytest import torch -from continuity.benchmarks.sine import SineBenchmark -from continuity.operators.shape import OperatorShapes, TensorShape -from continuity.operators.integralkernel import ( +from continuiti.benchmarks.sine import SineBenchmark +from continuiti.operators.shape import OperatorShapes, TensorShape +from continuiti.operators.integralkernel import ( NeuralNetworkKernel, NaiveIntegralKernel, Kernel, diff --git a/tests/operators/test_neuraloperator.py b/tests/operators/test_neuraloperator.py index 9693ce79..5c66c84f 100644 --- a/tests/operators/test_neuraloperator.py +++ b/tests/operators/test_neuraloperator.py @@ -1,10 +1,10 @@ import pytest -from continuity.operators.shape import TensorShape, OperatorShapes -from continuity.benchmarks.sine import SineBenchmark -from continuity.operators.integralkernel import NaiveIntegralKernel, NeuralNetworkKernel -from continuity.operators import NeuralOperator -from continuity.trainer import Trainer -from continuity.operators.losses import MSELoss +from continuiti.operators.shape import TensorShape, OperatorShapes +from continuiti.benchmarks.sine import SineBenchmark +from continuiti.operators.integralkernel import NaiveIntegralKernel, NeuralNetworkKernel +from continuiti.operators import NeuralOperator +from continuiti.trainer import Trainer +from continuiti.operators.losses import MSELoss from .util import get_shape_mismatches diff --git a/tests/operators/util.py b/tests/operators/util.py index aa9b174e..4d9af9af 100644 --- a/tests/operators/util.py +++ b/tests/operators/util.py @@ -1,8 +1,8 @@ from typing import List -from continuity.data import OperatorDataset -from continuity.operators.shape import OperatorShapes -from continuity.operators import Operator +from continuiti.data import OperatorDataset +from continuiti.operators.shape import OperatorShapes +from continuiti.operators import Operator def get_shape_mismatches( diff --git a/tests/pde/test_grad.py b/tests/pde/test_grad.py index 8a79379f..cca9bcb3 100644 --- a/tests/pde/test_grad.py +++ b/tests/pde/test_grad.py @@ -1,5 +1,5 @@ import torch -from continuity.pde.grad import grad, Grad, div, Div +from continuiti.pde.grad import grad, Grad, div, Div def test_grad(): diff --git a/tests/trainer/test_trainer.py b/tests/trainer/test_trainer.py index 2c5ca461..ff1fa171 100644 --- a/tests/trainer/test_trainer.py +++ b/tests/trainer/test_trainer.py @@ -1,9 +1,9 @@ import pytest import torch -from continuity.operators import DeepONet -from continuity.operators.common import DeepResidualNetwork -from continuity.benchmarks.sine import SineBenchmark -from continuity.trainer import Trainer +from continuiti.operators import DeepONet +from continuiti.operators.common import DeepResidualNetwork +from continuiti.benchmarks.sine import SineBenchmark +from continuiti.trainer import Trainer def train(): @@ -45,7 +45,7 @@ def f(x): depth=3, ) - # Define loss function (in Continuity style) + # Define loss function (in continuiti style) mse = torch.nn.MSELoss() def loss_fn(op, x, y): diff --git a/tests/transforms/fixtures.py b/tests/transforms/fixtures.py index 4be54b4e..31cac437 100644 --- a/tests/transforms/fixtures.py +++ b/tests/transforms/fixtures.py @@ -1,7 +1,7 @@ import pytest import torch -from continuity.transforms import Transform +from continuiti.transforms import Transform @pytest.fixture(scope="module") diff --git a/tests/transforms/test_compose.py b/tests/transforms/test_compose.py index 20a489a4..ca96de17 100644 --- a/tests/transforms/test_compose.py +++ b/tests/transforms/test_compose.py @@ -1,7 +1,7 @@ import pytest import torch -from continuity.transforms import Compose +from continuiti.transforms import Compose @pytest.fixture diff --git a/tests/transforms/test_quantile_scaler.py b/tests/transforms/test_quantile_scaler.py index cf119d3e..35f80659 100644 --- a/tests/transforms/test_quantile_scaler.py +++ b/tests/transforms/test_quantile_scaler.py @@ -1,7 +1,7 @@ import pytest import torch -from continuity.transforms import QuantileScaler +from continuiti.transforms import QuantileScaler @pytest.fixture(scope="module") diff --git a/tests/transforms/test_scaling.py b/tests/transforms/test_scaling.py index a0baaf68..4f4a6034 100644 --- a/tests/transforms/test_scaling.py +++ b/tests/transforms/test_scaling.py @@ -1,7 +1,7 @@ import pytest import torch -from continuity.transforms import Normalize +from continuiti.transforms import Normalize @pytest.fixture(scope="module")
OperatorParamsLearning Curve
{op}
({param_str})