Skip to content

Commit

Permalink
Created using Colaboratory
Browse files Browse the repository at this point in the history
  • Loading branch information
znah committed May 8, 2019
1 parent 7fb46ab commit 0eef19b
Showing 1 changed file with 14 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@
"id": "xy0Fs7UZ21ak",
"colab_type": "code",
"cellView": "form",
"outputId": "b09e7e58-c135-4ec7-bb4f-d5842060e473",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 221
},
"outputId": "b09e7e58-c135-4ec7-bb4f-d5842060e473"
}
},
"source": [
"#@title ← Click this button to upload a different image\n",
Expand Down Expand Up @@ -271,7 +271,7 @@
"\n",
"print('\\rimage uploaded, size:', im.size, end='')"
],
"execution_count": 10,
"execution_count": 0,
"outputs": [
{
"output_type": "display_data",
Expand Down Expand Up @@ -312,16 +312,19 @@
"id": "jbPlSLt_FWwG",
"colab_type": "code",
"cellView": "form",
"outputId": "0067d7f3-a402-4240-81f0-575f187d8ba5",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 1041
},
"outputId": "0067d7f3-a402-4240-81f0-575f187d8ba5"
}
},
"source": [
"#@title ← Click this button to render\n",
"#@markdown # CPPN pattern tool\n",
"#@markdown  \n",
"#@markdown This tool uses simple neural networks that map pixel coordinates to colors to represent image, that gets optimized. This approach is also known as [Compositional pattern-producing network](https://en.wikipedia.org/wiki/Compositional_pattern-producing_network).\n",
"#@markdown Optimization tries to generate an image, that produces activation pattern, similar to the target image, in a particular layer (defined by **layer_index**) of ImageNet-trained classification network. **v1** objective tries to match the average pattern, while **v2** tries to match the whole distrubution.\n",
"#@markdown **style_weight** parameter defines the contribution of [Gatys et al](https://arxiv.org/abs/1508.06576) style loss, and ignored in case of **v2** objective.\n",
"#@markdown **activation** function used in the image-generating CPPN influence the resulting image style.\n",
"\n",
"objective = 'v2' #@param ['v1', 'v2']\n",
"activation = 'composite' #@param ['composite', 'relu']\n",
Expand Down Expand Up @@ -389,7 +392,7 @@
"img = sess.run(t_image, {t_size:1024})[0]\n",
"show_tiled_image(img)\n"
],
"execution_count": 11,
"execution_count": 0,
"outputs": [
{
"output_type": "display_data",
Expand Down Expand Up @@ -437,16 +440,16 @@
"id": "AZ9jgnMCRBB-",
"colab_type": "code",
"cellView": "form",
"outputId": "93f9a36a-090d-46b2-b3ad-d70d800b498f",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 989
},
"outputId": "93f9a36a-090d-46b2-b3ad-d70d800b498f"
}
},
"source": [
"#@title ← Click this button to render\n",
"#@markdown # DeepDream pattern tool\n",
"#@markdown  \n",
"#@markdown This tool uses pixel based image representation and a [DeepDream-inspired](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/examples/tutorials/deepdream) multiscale pattern generation approach.\n",
"\n",
"preview_octave_n = 6\n",
"preview_octave_steps = 50\n",
Expand Down Expand Up @@ -619,7 +622,7 @@
" clear_output()\n",
" show_tiled_image(dream.rgb)"
],
"execution_count": 16,
"execution_count": 0,
"outputs": [
{
"output_type": "display_data",
Expand Down

0 comments on commit 0eef19b

Please sign in to comment.