Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
add tf_rnn_intro
  • Loading branch information
Toru Shimizu committed May 31, 2018
1 parent 6dbdedf commit c4de030
Showing 1 changed file with 52 additions and 34 deletions.
86 changes: 52 additions & 34 deletions tf_rnn_intro.ipynb
Expand Up @@ -2,21 +2,17 @@
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import tensorflow as tf"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"# simple rnn (1)\n",
Expand All @@ -35,9 +31,17 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[ 1. 2. 3. 4. 5.]\n"
]
}
],
"source": [
"with tf.Session() as sess:\n",
" fd = {x: [1, 1, 1, 1, 1]}\n",
Expand All @@ -48,15 +52,13 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -72,9 +74,17 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[ 1. 3. 6. 10. 15.]\n"
]
}
],
"source": [
"with tf.Session() as sess:\n",
" fd = {x: [1, 2, 3, 4, 5]}\n",
Expand All @@ -85,18 +95,14 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
"# simple rnn (3)\n",
Expand All @@ -114,9 +120,17 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 7,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[ 1. 2. 6. 24. 120.]\n"
]
}
],
"source": [
"with tf.Session() as sess:\n",
" fd = {x: [1, 2, 3, 4, 5]}\n",
Expand All @@ -127,18 +141,14 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
"# simple rnn (4)\n",
Expand All @@ -156,9 +166,17 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 9,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[ 0. 4. -9. -5. -9.]\n"
]
}
],
"source": [
"with tf.Session() as sess:\n",
" fd = {x: [4, 2, 9, -1, 3]}\n",
Expand Down

0 comments on commit c4de030

Please sign in to comment.