同步操作将从 weiweimao/LSTM-water-table-depth-prediction 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
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!
Python3.x(Tested with 3.5)
theano(Tested with 1.0.1)
numpy
pandas
scikit-learn
The code was tested with Python 3.5. To use this code, please do:
Clone the repo:
git clone https://github.com/jfzhang95/LSTM-water-table-depth-prediction.git
cd LSTM-water-table-depth-prediction
Install dependencies:
pip install theano matplotlib numpy pandas scikit-learn
To try the demo code, please run:
python demo.py
If installed correctly, the result should look like this:
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.
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.
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}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。