• Stars
    star
    171
  • Rank 222,266 (Top 5 %)
  • Language
    Jupyter Notebook
  • License
    MIT License
  • Created about 6 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Machine Learning in Python for Environmental Science Problems AMS Short Course Material

ams-ml-python-course

DOI

Machine Learning in Python for Environmental Science Problems AMS Short Course Material

Authors

  • David John Gagne, National Center for Atmospheric Research ([email protected])
  • Ryan Lagerquist, University of Oklahoma ([email protected])
  • Greg Herman, Amazon
  • Sheri Mickelson, National Center for Atmospheric Research

Requirements

The modules for this short course require Python 3.6 and the following Python libraries:

  • numpy
  • scipy
  • matplotlib
  • xarray
  • netcdf4
  • pandas
  • scikit-learn
  • tensorflow-gpu or tensorflow
  • keras
  • shapely
  • descartes
  • jupyter
  • ipython
  • jupyterlab
  • ipywidgets

The current pre-compiled version of tensorflow-gpu requires your machine to have an NVIDIA GPU, CUDA 9.0, CUDA Toolkit 9.0, and cuDNN 7. If you have different versions of CUDA available, you will have to build Tensorflow from source, which can take a few hours.

GPUs are recommended for modules 3 and 4 but are not needed for modules 1 and 2.

Data Access

The data for the course are stored online. The download_data.py script will download the data to the appropriate location and extract all files. The netCDF data is contained in a 2GB tar file, so make sure you have at least 4GB of storage available and a fast internet connection.

Course Videos

Setup Instructions (Local Install; CPU Only)

These instructions assume you have a bash shell running or the Windows command prompt. Conda environments do not work in csh.

  1. Install the miniconda Python distribution.
  2. Create a separate conda environment for the short course: conda create -n mlpy python=3.6
  3. Activate the enviornment by running source activate mlpy (bash in linux or mac) or activate mlpy (Windows)
  4. Install the required base libraries: conda install pip numpy scipy matplotlib scikit-learn netcdf4 xarray pandas ipython jupyter ipywidgets shapely descartes
  5. Install tensorflow and keras: pip install tensorflow; pip install keras
  6. Clone the short course repository: git clone https://github.com/djgagne/ams-ml-python-course.git
  7. Change into the ams-ml-python-course directory.
  8. Download the course data to your local machine: python download_data.py
  9. Start Jupyter lab: jupyter lab
  10. Each module is in a separate folder. Open the Jupyter notebook in each folder and follow instructions. If you have problems, please create an issue on the Github repository site.

Setup Instructions (Docker)

These instructions are for those who want to run the short course Docker image either on their local machine (requires Docker to be installed) or on a single cloud VM.

  1. Install Docker.
  2. From the command line, pull the appropriate short course Docker container:
    • CPU only: docker pull djgagne/ams-ml-python-course:cpu
    • GPU (requires NVIDIA GPU, CUDA and nvidia-docker): docker pull djgagne/ams-ml-python-course:gpu
  3. To start the container: docker run -p 8888:8888 djgagne/ams-ml-python-course:cpu or :gpu if you are using the CPU or GPU version.
  4. To access jupyter lab, open a web browser to localhost:8888 and paste in the token string from the command line.
  5. If you are running on a remote server, you will need to forward port 8888 to your local machine. You can do this over ssh if it is a remote server or through the web if you are running on a cloud server with port 8888 opened.

Optional Setting up GPU-enabled short course Jupyter hub containers

These instructions are for creating and managing your own short course managed by Jupyterhub on Kubernetes with everything in a Docker container. You do not need to follow these instructions if you are just trying to run the short course modules locally.

Requirements for architecture

  • Docker
  • Google Compute Engine
  • Google Kubernetes Engine
  • NVIDIA CUDA docker images
  • jupyter docker-stacks

Recipe

  • Start a Google Compute Engine instance with an NVIDIA GPU and install CUDA and docker. See here.
  • Clone the jupyter docker-stacks repository
  • In the base-notebook Docker file, change the BASE_CONTAINER to "nvidia/cuda:9.0-cudnn7-runtime-ubuntu16.04"
  • Build base notebook: >> docker build --rm -t username/base-notebook .
  • Change to docker-stacks/minimal-notebook directory and change the FROM option to username/base-notebook.
  • Build minimal notebook >> docker build --rm -t username/minimal-notebook .
  • Change to directory containing short course docker file.
  • Build the short course container >> docker build --rm -t username/ams-ml-short-course:gpu .
  • Login to docker hub with >> docker login
  • Push your container to Docker Hub.
  • Start a Kubernetes cluster on Google Cloud with 1 CPU node and 1 GPU node. Use preemptible instances to save a lot of money.
  • Log into a Kubernetes node and install CUDA here.
  • Wait until the nvidia drivers have been completely installed. Check status by typing in kubectl get pods --all-namespaces and wait for everything to be running.
  • Setup Jupyterhub on Google Cloud by following instructions here.

More Repositories

1

hagelslag

Hagelslag supports segmentation and tracking of weather fields and scalable verification, including performance diagrams and reliability diagrams.
Jupyter Notebook
68
star
2

lorenz_gan

Lorenz 96 model with GAN parameterization of unresolved scale (Y).
Jupyter Notebook
36
star
3

deepsky

Interpretable Deep Learning for Spatial Analysis of Severe Hailstorms
Jupyter Notebook
22
star
4

swirlnet

Deep learning tutorial for predicting low-level rotation.
Jupyter Notebook
18
star
5

solar_energy_prediction_contest

Example code for the AMS Solar Energy Prediction Contest (http://www.kaggle.com/c/ams-2014-solar-energy-prediction-contest).
Python
12
star
6

hagelslag-unidata

Object-based severe weather forecasting system.
Python
7
star
7

ucar_sea_2015

Presentation, code, and data for my presentation at the 2015 UCAR SEA Conference
Python
6
star
8

OWL_Verification

Verification System for the Oklahoma Weather Lab
Python
5
star
9

metro_state_spring_2017

Severe Weather Analysis and Forecasting with Python Tools tutorial.
Jupyter Notebook
4
star
10

ou_grad_5203_fall_2016

Data Analytics Lecture Notes
Jupyter Notebook
3
star
11

deepsounding

Jupyter Notebook
3
star
12

HWT_mode

Using image recognition to classify storm modes in a numerical model.
Jupyter Notebook
3
star
13

dissertation_notebooks

Dissertation hail verification notebooks
Jupyter Notebook
2
star
14

ams_ai_storm_mode_contest_2008

Data from the 2008 AMS AI Competition on predicting storm mode
HTML
2
star
15

field-autoencode

Testbed for autoencoding different kinds of fields.
Python
2
star
16

dl-demo-aspsc-2019

Deep Learning Demo for the ASP Summer Colloquium 2019
Jupyter Notebook
2
star
17

md_project

Project for Visual Analytics that is analyzing Mesoscale Discussions.
Python
2
star
18

ncstate_fall_2017

Teaching demo
Jupyter Notebook
2
star
19

ci_hackathon_2017

Processing code for Climate Informatics Hackathon 2017.
Jupyter Notebook
2
star
20

TensorFlow-Pokemon-Course

1
star
21

parf

Automatically exported from code.google.com/p/parf
Fortran
1
star
22

ml_class

Machine Learning class notes
1
star
23

tufte

TeX
1
star
24

amsmlpython

HTML
1
star
25

cal_rain

California Rainfall Prediction Hackathon for Climate Informatics 2017
Jupyter Notebook
1
star
26

devtest

Jupyter Notebook
1
star
27

ams-ml-python-course-admin

Dockerfile
1
star
28

haileval

Shared code for the evaluation of hail forecast models.
Jupyter Notebook
1
star
29

big_data_challenges_2017

1
star
30

icecaps

Web map visualization of storm-scale ensemble data for CAPS.
PHP
1
star
31

bootcamp

Python
1
star
32

california_rainfall_test

Jupyter Notebook
1
star
33

carbon_export_biomes

Jupyter Notebook
1
star
34

jetlation

Jupyter Notebook
1
star