Skip to content

JakobEliasWagner/NeuralOperators

Repository files navigation

Neural Operators

Neural Operators

Learning neural operators for parameterized geometries in the context of sonic crystals and the acoustic Helmholtz equation. The data-generation of this problem has been moved to a dedicated repository as this implementation does not directly touch the implementation of the operators.

Python 3.8 Code Coverage Documentation Linkedin

Getting Started with Neural Operators

Welcome to Neural Operators! This guide will help you set up your development environment so you can start training and benchmarking Neural Operators for parameterized sonic crystals. Follow the steps below to install the required dependencies and get up and running.

Installation

To install Neural Operators along with all necessary and optional dependencies, please ensure you have pip installed. Then, run the following command in your terminal:

pip install .[dev,doc,test,optimize]

This command installs the Neural Operators package with various optional dependencies categorized for different purposes:

  • optimize: Used to optimize models and analyze the training of operators, including libraries such as Optuna and MLFlow.
  • test: Integrates pytest and pytest-cov for generating coverage reports and facilitating comprehensive testing.
  • dev: Includes tools to aid in development and maintain code quality, such as Black, Ruff, and pre-commit hooks.
  • doc: Provides the necessary tools to build and view the project's documentation locally.

Setting Up Pre-commit Hooks

To maintain code quality and consistency, we use pre-commit hooks. After installing the development dependencies, set up the git hook scripts by running:

pre-commit install

With this setup, pre-commit will automatically check your commits for style and errors.

Running Tests

To ensure the integrity of your code and that all functionalities work as expected, run the tests provided:

pytest tests/

Make sure you have the test optional dependencies installed to execute the tests successfully.

Building the Documentation

Our project comes with comprehensive documentation to help you understand and use Neural Operators effectively. You can access the online version here.

To build the documentation locally, ensure the doc dependencies are installed, and run the following commands:

pytest --cov=src/nos --cov-report html:doc/source/_static/codecov tests/
sphinx-apidoc -f -o docs/source/ src/nos
sphinx-build -M html docs/source docs/build

These commands will generate a coverage report, document the project using docstrings, and build the HTML documentation. You can find the built documentation in docs/build/html. Open index.html to view it locally.

Releases

No releases published

Packages

No packages published

Languages