Updating DeepSpeech for 0.10 API

This commit is contained in:
Alexandre Lissy 2016-08-09 18:57:46 +02:00
parent 78c93711f1
commit 8592093ffc

View File

@ -101,8 +101,7 @@
"outputs": [],
"source": [
"import tensorflow as tf\n",
"from tensorflow.python.ops.constant_op import constant\n",
"from tensorflow.models.rnn import rnn, rnn_cell\n",
"from tensorflow.python.framework.constant_op import constant\n",
"import numpy as np"
]
},
@ -513,15 +512,15 @@
" \n",
" # Define lstm cells with tensorflow\n",
" # Forward direction cell\n",
" lstm_fw_cell = rnn_cell.BasicLSTMCell(n_cell_dim, forget_bias=1.0)\n",
" lstm_fw_cell = tf.nn.rnn_cell.BasicLSTMCell(n_cell_dim, forget_bias=1.0)\n",
" # Backward direction cell\n",
" lstm_bw_cell = rnn_cell.BasicLSTMCell(n_cell_dim, forget_bias=1.0)\n",
" lstm_bw_cell = tf.nn.rnn_cell.BasicLSTMCell(n_cell_dim, forget_bias=1.0)\n",
" \n",
" # Split data because rnn cell needs a list of inputs for the BRNN inner loop\n",
" layer_3 = tf.split(0, n_steps, layer_3)\n",
" \n",
" # Get lstm cell output\n",
" outputs = rnn.bidirectional_rnn(lstm_fw_cell,\n",
" outputs = tf.nn.bidirectional_rnn(lstm_fw_cell,\n",
" lstm_bw_cell,\n",
" layer_3,\n",
" initial_state_fw=_istate_fw,\n",
@ -585,9 +584,9 @@
"```python\n",
" # Define lstm cells with tensorflow\n",
" # Forward direction cell\n",
" lstm_fw_cell = rnn_cell.BasicLSTMCell(n_cell_dim, forget_bias=1.0)\n",
" lstm_fw_cell = tf.nn.rnn_cell.BasicLSTMCell(n_cell_dim, forget_bias=1.0)\n",
" # Backward direction cell\n",
" lstm_bw_cell = rnn_cell.BasicLSTMCell(n_cell_dim, forget_bias=1.0)\n",
" lstm_bw_cell = tf.nn.rnn_cell.BasicLSTMCell(n_cell_dim, forget_bias=1.0)\n",
"```\n",
"both of which have inputs of length `n_cell_dim` and bias `1.0` for the forget gate of the LSTM.\n",
"\n",
@ -601,7 +600,7 @@
"The next line of `BiRNN`\n",
"```python\n",
" # Get lstm cell output\n",
" outputs = rnn.bidirectional_rnn(lstm_fw_cell,\n",
" outputs = tf.nn.bidirectional_rnn(lstm_fw_cell,\n",
" lstm_bw_cell,\n",
" layer_3,\n",
" initial_state_fw=_istate_fw,\n",
@ -1224,7 +1223,7 @@
},
{
"cell_type": "code",
"execution_count": 20,
"execution_count": null,
"metadata": {
"collapsed": true
},