Coder Social home page Coder Social logo

young6257 / lstm-water-table-depth-prediction Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jfzhang95/lstm-water-table-depth-prediction

0.0 0.0 0.0 299 KB

Theano implementation of our paper 'Developing a Long Short-Term Memory (LSTM) based Model for Predicting Water Table Depth in Agricultural Areas', Journal of Hydrology.

License: MIT License

Python 16.22% Jupyter Notebook 83.78%

lstm-water-table-depth-prediction's Introduction

LSTM based Model for Water Table Depth Prediction

Introduction

This is a Theano implementation of our work Developing a Long Short-Term Memory (LSTM) based Model for Predicting Water Table Depth in Agricultural Areas. [Paper]

NEW: PyTorch implementation also available: Water-Table-Depth-Prediction-PyTorch!

Requirements

Python3.x(Tested with 3.5)
theano(Tested with 1.0.1)
numpy
pandas
scikit-learn

Installation

The code was tested with Python 3.5. To use this code, please do:

  1. Clone the repo:

    git clone https://github.com/jfzhang95/LSTM-water-table-depth-prediction.git
    cd LSTM-water-table-depth-prediction
  2. Install dependencies:

    pip install theano matplotlib numpy pandas scikit-learn
  3. To try the demo code, please run:

    python demo.py

If installed correctly, the result should look like this: results

Noted that the demo data (demo.csv) are processed manually, so they are not real data, but they still can reflect the correlation between the original data.

Tutorials

A model training and testing pipeline can be defined as:

def LSTM_FC_prediction(X, Y, X_test=None, iters=20000, learning_rate=1e-4, dropout_prob=0.5):
    if dropout_prob > 1. or dropout_prob < 0.:
        raise Exception('Dropout level must be in interval [0, 1]')
    num_month = Y.shape[0]
    input_shathinkpe = X.shape[1]
    model = LSTM_FC_Model(num_input=input_shape, num_hidden=[40], num_output=1)
    print('Start training......')
    for iter in range(iters + 1):
        loss = model.fit(X, Y, learning_rate, dropout_prob)
        if iter % 1000 == 0:
            print("iteration: %s, loss: %s" % (iter, loss))
    # Saving model
    model.save_model_params('checkpoints/LSTM_FC_CKPT')

    print('Start predicting......')
    Y_test = model.predict(X_test)
    print('Done.')
    return Y_test

For more details, please see in tuitorials.

Citation

If you use this code, please consider citing the following paper:

@article{zjf18,
  journal        = {Journal of Hydrology},
  title          = {Developing a Long Short-Term Memory (LSTM) based Model for Predicting Water Table Depth in Agricultural Areas},
  author         = {Jianfeng Zhang, Yan Zhu, Xiaoping Zhang, Ming Ye and Jinzhong Yang},
  year           = {2018},
  volume         = {561},
  pages          = {918-929}
}

License

MIT

lstm-water-table-depth-prediction's People

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.