GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - DataWaveProject/FTorch-coupling-examples: Test Fortran coupling to neural networks using FTorch for GW parameterisation

BranchesTags
Open more actions menu

Latest commit

 

History

15 Commits
15 Commits

Folders and files

NameName
Last commit message
Last commit date
CNN-simple
CNN-simple
 
 
FNO-1D
FNO-1D
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 

Repository files navigation

FTorch_coupling_examples

Usage

These examples provide complete demonstrations of how to use FTorch to couple various neural network implementations in PyTorch using Fortran.

  • CNN-simple: Train a simple CNN to predict y = x + 1 mapping where x is a 2D tensor of random values between -1 and 1 of size (bs, 1, 20, 20), where domain size is 20 * 20. The example runs inference in Python and Fortran and checks that error is within an acceptable tolerance.

  • FNO-1D: Train a simple FNO-1D network to predict the sin wave sin(2πx) given an input of some dummy values and a uniform grid of x-positions on [0, 1], and the target sine wave. The example runs inference in Python and Fortran with the same dummy values and unform grid.

Installation

Install FTorch as described here, then compile the examples by following the README in each directory. For illustration, the cmake command will look something like the following (if using LibTorch - otherwise use PyTorch).

cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="/path/to/libtorch/share/cmake/Torch/;/path/to/FTorch/lib/cmake/FTorch/"

Acknowledgements

This module includes an implementation of Fourier Neural Operators in FNO-1d/fno-1d.py adapted from Pahlavan et al. (2024), On the importance of learning non-local dynamics for stable data-driven climate modeling: A 1D gravity wave-QBO testbed, as made available in their accompanying repository HamidPahlavan/Nonlocality Portions of the code are used under the MIT License.

About

Test Fortran coupling to neural networks using FTorch for GW parameterisation

Resources

Readme
MIT license
Activity
Custom properties

Stars

1 star

Watchers

4 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.