Skip to main content

A differentiable neural-network solver for data assimilation of ice shelves written in JAX

Project description

DIFFICE_jax

A DIFFerentiable neural-network solver for data assimilation of ICE shelves written in JAX.

Introduction

DIFFICE_jax is a Python package that solves the depth-integrated Stokes equation for ice shelves, and can be adopted for ice sheets by modifying the partial differential equations (PDE) in the neural network loss function. It uses PDEs to interpolate descretized remote-sensing data into meshless and differentible functions, and infer ice shelves' viscosity structure via back-propagation and automatic differentiation (AD). The algorithm is based on physics-informed neural networks (PINNs) and implemented in JAX. The DIFFICE_jax package involves several advanced features in addition to vanilla PINNs algorithms, including collocation points resampling, non-dimensionalization of the data adnd equations, extended-PINNs (XPINNs) (see figure below), viscosity exponential scaling function, which are essential for accurate inversion. The package is designed to be user-friendly and accessible for beginners. The Github respository also provides Colab Notebooks for both the synthetic and real ice-shelf examples in the tutorial and examples folders, respectively.


xpinns.


Statement of Needs

This package provides a neural network-based approach for solving inverse problems in glaciology, specifically for estimating effective ice viscosity from high-resolution remote sensing data. Ice viscosity is a key parameter for predicting ice-shelf dynamics, but direct in-situ measurements of viscosity across Antarctica are impractical. Traditional adjoint methods require deriving additional equations and applying regularization techniques to handle noisy data. In contrast, neural networks can inherently de-noise while solving the inverse problem without explicit regularization. Finally, this solver is fully differentiable using automatic differentiation (AD), eliminating the need for manual adjoint derivations and enabling efficient exploration of complex PDEs, including anisotropic ice flow models. This neural network-based method offers a flexible framework for solving inverse problems in glaciology.

Installation

The build of the code is tesed on Python version (3.9, 3.10 and 3.11) and JAX version (0.4.20, 0.4.23, 0.4.26)

You can install the package using pip as follows:

python -m pip install DIFFICE_jax

Documentation

Find the full documentation here. We provided the documentation for both the algorithms (e.g., cost functions) and the mathematical formulation (e.g., PDEs and boundary conditions) for the data assimilation of ice shelves.

Getting Started with a Tutorial using Synthetic Data Open In Colab

We highly recommend new users to get familar with the software by reading the document and playing with the synthetic example prepared in the tutorial folder. The synthetic example allow users to generate the synthetic data of velocity and thickness of an ice-shelf flow in an idealized rectangular domain with a prescribed viscosity profile. Users can use the Colab Notebook to infer the viscosity from the synthetic velocity and thickness, and compare with the given synthetic viscosity to validate the PINN result.

Real-data Examples

The inversion codes with the real velocity and thickness data for four different ice shelves surrounding the Antarctica are provided in the examples folders. For each example code, the corresponding implemented features and the ice-shelf dataset it can analyze are listed in the table below. The original source and the required format for the datasets are described here. In the paper, we summarized six algorithm features of the DIFFICE_jax package, (1)-(6), beyond the vanilla PINNs code.

Example codes Algorithm feature # Ice shelf
train_pinns_iso (1), (2), (3), (4) Amery, Larsen C, synthetic
train_pinns_aniso (1), (2), (3), (4), (6) Amery, Larsen C
train_xpinns_iso (1), (2), (3), (4), (5) Ross, Ronne-Filchner
train_xpinns_aniso (1), (2), (3), (4), (5), (6) Ross, Ronne-Filchner

Google Colab

Apart from the Python scripts to run locally, we also provide Colab Notebooks for both the synthetic and real ice-shelf examples, provided in the tutorial and examples folders, respectively.


Diagram of Algorithm and Results.

setups

Contributors

This package is written by Yongji Wang and maintained by Yongji Wang (yongjiw@stanford.edu) and Ching-Yao Lai (cyaolai@stanford.edu). If you have questions about this code and documentation, or are interested in contributing the development of the DIFFICE_jax package, please see the contributing guidelines for information on submitting issues and pull requests.

License

DIFFICE_jax is an open-source software. All code within the project is licensed under the MIT License. For more details, please refer to the LICENSE file.

Citation

Y. Wang and C.-Y. Lai, "DIFFICE-jax: Differentiable neural-network solver for data assimilation of ice shelves in JAX," under review, 2025

@article{wang2025diffice
  title={DIFFICE-jax: Differentiable neural-network solver for data assimilation of ice shelves in JAX},
  author={Wang, Yongji and Lai, Ching-Yao},
  year={2025},
  journal={},
  doi = {},
}

Y. Wang, C.-Y. Lai, D. J. Prior and C. Cowen-Breen, "Deep learning the flow law of Antarctica ice shelves," Science, 2025

@article{wang2025deep
  title={Deep learning the flow law of Antarctic ice shelves},
  author={Wang, Yongji and Lai, Ching-Yao and Prior, David J. and Cowen-Breen, Charlie},
  year={2025},
  journal={Science},
  doi = {https://doi.org/10.1126/science.adp3300},
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

diffice_jax-1.0.0.tar.gz (21.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

diffice_jax-1.0.0-py3-none-any.whl (29.8 kB view details)

Uploaded Python 3

File details

Details for the file diffice_jax-1.0.0.tar.gz.

File metadata

  • Download URL: diffice_jax-1.0.0.tar.gz
  • Upload date:
  • Size: 21.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.22

File hashes

Hashes for diffice_jax-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f247d551d928d435660c293172dfad86518a2aa660ba447ed0b76ec64cb9aaae
MD5 4e2ac8c42f0cc5117798f758430cb1c6
BLAKE2b-256 28037f190793440c115483fd1190610614b9df59f5025c7002438ea1062402d3

See more details on using hashes here.

File details

Details for the file diffice_jax-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: diffice_jax-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 29.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.22

File hashes

Hashes for diffice_jax-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c8b39452cd8ec21a158b651f89778da71e0736a4ec180bbfad0e88d0b2312615
MD5 4d60cce4d06a60d299bdbf4ca375c05b
BLAKE2b-256 54d56f16d775611b8107855e28f1afa91961e6ddf75411d3c300402c3acf3953

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page