Giter Club home page Giter Club logo

deepeddy's Introduction

DeepEddy


fig1


This repository contains the python code used for the paper titled:

"Applications of Deep Learning to Ocean Data Inference and Sub-Grid Parameterisation".

Thomas Bolton, Laure Zanna

Atmospheric, Oceanic, and Planetary Physics, University of Oxford

[email protected]

This repository contains the python code, the saved trained neural networks from Keras, and their validation losses during training. The primary file is DeepEddy.py, which contains functions to calculate the eddy momentum forcing, training individual neural networks, and form predictions using the validation data.

Activation Maps

Included in DeepEddy.py is a function which extracts the activation maps of each convolution layer and plots them for a particular input sample. The activation map is the result of the convolution acting on the previous layers output, and then passing it through the activation function.

In order to examine more clearly what each convolution layer is doing, we construct a "clean" input streamfunction to feed into one of the already-trained neural networks. We use a radially-symmetric Gaussian function to generate a "fake" eddy streamfunction to use as an input. We then give this input to the neural network, and examine the activation maps at each stage. The results are shown in the image below.

The interesting part are the activation maps of the first convolution layer. These activation maps resemble a collection of 1st and 2nd order derivatives. Therefore, without a priori knowledge, the neural network learns to take derivates of the input streamfunction, which physically corresponds to velocities and velocity shears. This is a robust feature across all of the neural networks trained to predict the eddy momentum forcing.

fig2

Most of the functions in DeepEddy.py cannot be run solely using the contents of this repository, as the data files (for training and predicting) are too large (~2 GB per file) to upload to GitHub. However, the function to plot the activation maps can be run from the contents of this repository, as it only needs the file for a trained neural network. Any of the neural networks saved in the 'models/' directory will do. To create the above image of the activation maps, simply run the following code.

from DeepEddy import *

# the function below will use the saved
# neural network 'cnn30km_1_Sx_200e.h5'
 
plotSyntheticActivationMaps()

deepeddy's People

Contributors

tombolton avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.