资源简介
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
评论
共有 条评论