GithubHelp home page GithubHelp logo

seismolabmodelinggroup / learning-aftershock-location-patterns Goto Github PK

View Code? Open in Web Editor NEW

This project forked from phoebemrdevries/learning-aftershock-location-patterns

0.0 2.0 0.0 203 KB

Training, testing, evaluation codes for learning aftershock location patterns

License: MIT License

Python 81.27% MATLAB 18.73%

learning-aftershock-location-patterns's Introduction

Learning-aftershock-location-patterns

Training, testing, evaluation codes for learning aftershock location patterns

Note that python codes are written using Python 2.7 and Keras (https://keras.io/) with Theano as a backend. As Theano is currently being phased out of Keras, future projects will use Python 3 and Keras with TensorFlow.

Brief description of scripts/functions

BuildTrainingTestingData.py: Script to build the training and testing data sets. When run, creates the new testing/training data sets “Testing_Tmp.h5” and “Training_Tmp.h5.”

TrainModel.py: Script to read in training data and train the neural network.

modelfunctions.py: Assorted functions for reading and writing CSV and HDF files, creating and training the neural network, etc.

EvalModel.py: Evaluate the trained network on the testing data.

Calculate_ROC_and_AUC_NN.py: Script to calculate and save (for later plotting) the ROC curves and associated AUC values associated with the neural network model for each slip distribution in the testing data set. Saves these quantities to “AllROC_NN.pkl.”

Calculate_ROC_and_AUC_OtherQuantities.py: Script to calculate and save (for later plotting) the ROC curves and associated AUC values associated with maximum shear stress change, von-Mises criteria change, and Coulomb failure stress change for each slip distribution in the testing data set. Saves these quantities to “AllROC_OtherQuantities.pkl.”

PlotThreeTestCases.py: Script to plot three cases from the testing data set.

Plot_ROC_Curves.py: Using the pickle files generated by Calculate_ROC_and_AUC_NN.py and Calculate_ROC_and_AUC_OtherQuantities.py, this script plots ROC curves for maximum shear stress change, the von-Mises yield criterion change, Coulomb failure stress change, and the NN.

GenerateInputs_IdealizedOkadaCase.m: This MATLAB script generates the input features (the components of the stress change tensor) for an idealized strike-slip earthquake case (note this script requires Brendan Meade’s triangular dislocation code available at: https://github.com/brendanjmeade/tde).

RunNNPrediction_IdealizedOkadaCase.py: This script runs the neural network forward prediction of the aftershock probabilities for the idealized strike-slip earthquake case, using the input files generated by GenerateInputs_IdealizedOkadaCase.m.

PlotQuantitiesIdealizedFault.m: This MATLAB script plots maximum shear stress change, von-Mises criteria change, Coulomb failure stress change, and the NN forecast for an idealized strike-slip case.

Data

Files below available at: https://drive.google.com/drive/folders/1lAHfdjFd-Uv3wJcA0Tk2ViDIZeFt0mCA?usp=sharing

AllCSV: This folder contains CSV files for each slip distribution used in this project

Testing_Filenames.h5: This index HDF file contains one list called “file_names_testing” – it is a list of the slip distributions randomly selected for the testing data set.

Training_Filenames.h5: This index HDF file contains one list called “file_names_training” – it is a list of the slip distributions randomly selected for the training data set.

Training.h5: This HDF file contains the training data organized into 7 data sets: the six features (stresses_full_xx, stresses_full_xy, stresses_full_yy, stresses_full_xz, stresses_full_yz, stresses_full_zz) and corresponding labels (aftershocksyn).

Testing.h5: This HDF file contains the testing data organized into 7 data sets: the six features (stresses_full_xx, stresses_full_xy, stresses_full_yy, stresses_full_xz, stresses_full_yz, stresses_full_zz) and corresponding labels (aftershocksyn).

1999CHICHI01MAxx.h5, 1995KOBEJA01YOSH.h5, 2005KASHMI01SHAO.h5: HDF files containing the x, y (UTM) coordinates of the slip distributions used in PlotThreeTestCases.py

TheBestWeights.h5: An HDF file containing the weights/biases associated with the trained neural network.

learning-aftershock-location-patterns's People

Contributors

phoebedevries avatar phoebemrdevries avatar

Watchers

James Cloos avatar Eric Eckert 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.