資源簡介
tensorflow 實現卷積LSTM,參見文章Convolutional LSTM Network: A Machine Learning Approach for Precipitation Nowcasting
代碼片段和文件信息
#?-*-?coding:?utf-8?-*-??
import?tensorflow?as?tf
import?numpy?as?np
import?os
from?cell?import?ConvLSTMCell
if?‘session‘?in?locals()?and?session?is?not?None:
????print(‘Close?interactive?session‘)
????session.close()
def?main():
????shape=[132?228]
????kernel?=?[3?3]
????filters?=?12
????batch_size=181
????num_steps=8
????channels=7
????inputs?=?tf.placeholder(tf.float32?[batch_size?num_steps]?+?shape?+?[channels])
????cell?=?ConvLSTMCell(shape?filters?kernel)
????outputs?state?=?tf.nn.dynamic_rnn(cell?inputs?dtype=inputs.dtype?time_major=True)
????print(inputs.shape)
????with?tf.Session()?as?sess:
????????sess.run(tf.global_variables_initializer())
????????for?idx?epoch?in?enumerate(gen_epochs(num_epochs?num_steps)):
????????????for?step?(X?Y)?in?enume
- 上一篇:doc2vec在線訓練程序
- 下一篇:GPS標準單點定位代碼.zip
評論
共有 條評論