Skip to content

Commit

Permalink
Reset tutorial.ipynb to previous commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
joel-shor committed Mar 30, 2018
1 parent abf32e5 commit f3a542b
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions research/gan/tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -101,6 +101,7 @@
"import numpy as np\n",
"import time\n",
"import functools\n",
"from six.moves import xrange # pylint: disable=redefined-builtin\n",
"\n",
"import tensorflow as tf\n",
"\n",
Expand Down Expand Up @@ -1066,14 +1067,20 @@
}
],
"source": [
"def _get_next(iterable):\n",
" try:\n",
" return iterable.next() # Python 2.x.x\n",
" except AttributeError:\n",
" return iterable.__next__() # Python 3.x.x\n",
"\n",
"# Run inference.\n",
"predict_input_fn = _get_predict_input_fn(36, NOISE_DIMS)\n",
"prediction_iterable = gan_estimator.predict(\n",
" predict_input_fn, hooks=[tf.train.StopAtStepHook(last_step=1)])\n",
"predictions = [prediction_iterable.next() for _ in xrange(36)]\n",
"predictions = [_get_next(prediction_iterable) for _ in xrange(36)]\n",
"\n",
"try: # Close the predict session.\n",
" prediction_iterable.next()\n",
" _get_next(prediction_iterable)\n",
"except StopIteration:\n",
" pass\n",
"\n",
Expand Down Expand Up @@ -1889,7 +1896,7 @@
"assert images_to_eval % cat_dim == 0\n",
"\n",
"unstructured_inputs = tf.random_normal([images_to_eval, noise_dims-cont_dim])\n",
"cat_noise = tf.constant(range(cat_dim) * (images_to_eval // cat_dim))\n",
"cat_noise = tf.constant(list(range(cat_dim)) * (images_to_eval // cat_dim))\n",
"cont_noise = tf.random_uniform([images_to_eval, cont_dim], -1.0, 1.0)\n",
"\n",
"with tf.variable_scope(infogan_model.generator_scope, reuse=True):\n",
Expand Down

0 comments on commit f3a542b

Please sign in to comment.