因为现在的 example 都比较复杂涉及东西比较多,抽出来一个极简版本。
#!/usr/bin/env python# -*- coding: utf-8 -*-import tensorflow as tffrom tensorflow.contrib import rnnimport numpy as npx=tf.placeholder(dtype=tf.float64,shape=[10,10,10],name="x")train_x = np.ones(shape=[10, 10, 10], dtype=float)cell=tf.nn.rnn_cell.BasicLSTMCell(10)unstack_x = tf.unstack(x, 10, 1)lstm_cell = rnn.BasicLSTMCell(10, forget_bias=1.0)outputs, states = rnn.static_rnn(lstm_cell, unstack_x, dtype=tf.float64)with tf.Session() as sess: sess.run(tf.global_variables_initializer()) outputs_array=(sess.run(outputs,feed_dict={x:train_x}))继续阅读与本文标签相同的文章
-
Serpent.AI - 游戏代理框架(Python)
2026-05-26栏目: 教程
-
face-alignment:用 pytorch 实现的 2D 和 3D 人脸对齐库
2026-05-26栏目: 教程
-
ZhuSuan 是建立在Tensorflow上的贝叶斯深层学习的 python 库
2026-05-26栏目: 教程
-
pix2code:从截图生成图形用户界面代码
2026-05-26栏目: 教程
-
SSD:TensorFlow中的单次多重检测器
2026-05-26栏目: 教程
