Skip to content
Permalink
Browse files

fixing some odd residual merge conflicts

  • Loading branch information...
jakubLangr committed Jul 29, 2019
1 parent e7f668f commit 5f40c048eeaf256e3c2f395840c1b196a5fe6894
Showing with 1 addition and 65 deletions.
  1. +1 −65 chapter-6/Chapter_6_PGGAN.ipynb
@@ -140,11 +140,7 @@
" # minibatch group must be divisible by (or <=) group_size\n",
" group_size = K.backend.minimum(group_size, tf.shape(layer)[0])\n",
"\n",
<<<<<<< HEAD
" # just getting some shape information so that we can use\n",
=======
" # just getting some shape information so that we can use\n",
>>>>>>> 256a71fd698a5cae64ddf5ad4fc4b17a395327cf
" # them as shorthand as well as to ensure defaults\n",
" shape = list(K.int_shape(input))\n",
" shape[0] = tf.shape(input)[0]\n",
@@ -193,19 +189,13 @@
"source": [
"def equalize_learning_rate(shape, gain, fan_in=None):\n",
" '''\n",
<<<<<<< HEAD
" This adjusts the weights of every layer by the constant from\n",
" He's initializer so that we adjust for the variance in the dynamic range\n",
" in different features\n",
" shape : shape of tensor (layer): these are the dimensions of each layer.\n",
" For example, [4,4,48,3]. In this case, \n",
" [kernel_size, kernel_size, number_of_filters, feature_maps]. \n",
" But this will depend slightly on your implementation.\n",
=======
" This adjusts the weights of every layer by the constant from He's initializer so that we adjust for the variance in the dynamic range in different features\n",
" shape : shape of tensor (layer): these are the dimensions of each layer.\n",
" For example, [4,4,48,3]. In this case, [kernel_size, kernel_size, number_of_filters, feature_maps]. But this will depend slightly on your implementation.\n",
>>>>>>> 256a71fd698a5cae64ddf5ad4fc4b17a395327cf
" gain : typically sqrt(2)\n",
" fan_in : adjustment for the number of incoming connections as per Xavier's / He's initialization \n",
" '''\n",
@@ -400,17 +390,12 @@
},
{
"cell_type": "code",
<<<<<<< HEAD
"execution_count": 1,
=======
"execution_count": null,
>>>>>>> 256a71fd698a5cae64ddf5ad4fc4b17a395327cf
"metadata": {
"colab": {},
"colab_type": "code",
"id": "KNM3kA0arrUu"
},
<<<<<<< HEAD
"outputs": [
{
"name": "stdout",
@@ -437,9 +422,6 @@
]
}
],
=======
"outputs": [],
>>>>>>> 256a71fd698a5cae64ddf5ad4fc4b17a395327cf
"source": [
"# Install the latest Tensorflow version.\n",
"!pip install --quiet \"tensorflow>=1.7\"\n",
@@ -451,11 +433,7 @@
},
{
"cell_type": "code",
<<<<<<< HEAD
"execution_count": 22,
=======
"execution_count": null,
>>>>>>> 256a71fd698a5cae64ddf5ad4fc4b17a395327cf
"metadata": {
"cellView": "form",
"colab": {},
@@ -472,10 +450,6 @@
"import tensorflow as tf\n",
"import tensorflow_hub as hub\n",
"import time\n",
<<<<<<< HEAD
=======
"from google.colab import files\n",
>>>>>>> 256a71fd698a5cae64ddf5ad4fc4b17a395327cf
"from IPython import display\n",
"from skimage import transform\n",
"\n",
@@ -520,21 +494,12 @@
"def display_images(images, captions=None):\n",
" num_horizontally = 5\n",
" f, axes = plt.subplots(\n",
<<<<<<< HEAD
" len(images) // num_horizontally, num_horizontally, figsize=(20, 20))\n",
" for i in range(len(images)):\n",
" axes[i // num_horizontally, i % num_horizontally].axis(\"off\")\n",
" if captions is not None:\n",
" axes[i // num_horizontally, i % num_horizontally].text(0, -3, captions[i])\n",
" axes[i // num_horizontally, i % num_horizontally].imshow(images[i])\n",
=======
" len(images) / num_horizontally, num_horizontally, figsize=(20, 20))\n",
" for i in range(len(images)):\n",
" axes[i / num_horizontally, i % num_horizontally].axis(\"off\")\n",
" if captions is not None:\n",
" axes[i / num_horizontally, i % num_horizontally].text(0, -3, captions[i])\n",
" axes[i / num_horizontally, i % num_horizontally].imshow(images[i])\n",
>>>>>>> 256a71fd698a5cae64ddf5ad4fc4b17a395327cf
" f.tight_layout()\n",
"\n",
"tf.logging.set_verbosity(tf.logging.ERROR)"
@@ -564,17 +529,12 @@
},
{
"cell_type": "code",
<<<<<<< HEAD
"execution_count": 4,
=======
"execution_count": null,
>>>>>>> 256a71fd698a5cae64ddf5ad4fc4b17a395327cf
"metadata": {
"colab": {},
"colab_type": "code",
"id": "fZ0O5_5Jhwio"
},
<<<<<<< HEAD
"outputs": [
{
"data": {
"output_type": "display_data"
}
],
=======
"outputs": [],
>>>>>>> 256a71fd698a5cae64ddf5ad4fc4b17a395327cf
"source": [
"def interpolate_between_vectors():\n",
" with tf.Graph().as_default():\n",
},
{
"cell_type": "code",
<<<<<<< HEAD
"execution_count": 5,
=======
"execution_count": null,
>>>>>>> 256a71fd698a5cae64ddf5ad4fc4b17a395327cf
"metadata": {
"cellView": "form",
"colab": {},
"colab_type": "code",
"id": "phT4W66pMmko"
},
<<<<<<< HEAD
"outputs": [
{
"data": {
"output_type": "display_data"
}
],
=======
"outputs": [],
>>>>>>> 256a71fd698a5cae64ddf5ad4fc4b17a395327cf
"source": [
"image_from_module_space = True # @param { isTemplate:true, type:\"boolean\" }\n",
"\n",
" _, loss_out, im_out = session.run([train, loss, image])\n",
" images.append(im_out[0])\n",
" losses.append(loss_out)\n",
<<<<<<< HEAD
" print(loss_out)\n",
" return images, losses\n",
"\n",
"source": [
"captions = [ f'Loss: {l:.2}' for l in result[1]]\n",
"display_images(result[0], captions)"
=======
" print loss_out\n",
" return images, losses\n",
"\n",
"\n",
"result = find_closest_latent_vector(num_optimization_steps=40)\n",
"display_images(result[0], [(\"Loss: %.2f\" % loss) for loss in result[1]])"
>>>>>>> 256a71fd698a5cae64ddf5ad4fc4b17a395327cf
]
},
{
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
<<<<<<< HEAD
"version": "3.6.8"
=======
"version": "3.7.1"
>>>>>>> 256a71fd698a5cae64ddf5ad4fc4b17a395327cf
"version": "3.7.3"
}
},
"nbformat": 4,

0 comments on commit 5f40c04

Please sign in to comment.
You can’t perform that action at this time.