Function Repository Resource:

DeepDreamAlpha

Source Notebook

Render the image using the DeepDream-α algorithm

Contributed by: Aster Ctor

ResourceFunction["DeepDreamAlpha"][image]

renders image using the deepdream-α algorithm.

ResourceFunction["DeepDreamAlpha"][image,n]

renders image using n iterations.

Details and Options

ResourceFunction["DeepDreamAlpha"] has the following options:
"Depth"24network activation depth
"StepSize"1step size of each pattern overlay iteration
TargetDevice"CPU"works same as NetChain
WorkingPrecision"Real32"works same as NetChain

Examples

Basic Examples (2) 

Start with an image:

In[1]:=
img = ExampleData[{"TestImage", "House"}]
Out[1]=

Now process it with DeepDreamAlpha:

In[2]:=
ResourceFunction["DeepDreamAlpha"][img, 9]
Out[2]=

Scope (1) 

Use GPU acceleration:

In[3]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/7d254cc5-0021-4f3e-8b6f-561c4b514ef6"]
Out[3]=

Options (3) 

Depth (1) 

The activation depth is an integer between 1 and 30. The default is to activate layer 24. Shallow layers tend to be fine textures, while deep layers tend to be abstract patterns:

In[4]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/03f80d4d-bb85-416a-8224-d581bc4fb654"]
Out[4]=

StepSize (2) 

The smaller the step size, the smoother the final result will be:

In[5]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/a7a2bdd0-e59e-4259-acd9-3f449b1aeae2"]
Out[5]=
In[6]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/7eb52292-97b9-4eae-9bbe-200b2397da22"]
Out[6]=

Note that due to the accumulation of errors, the results are completely different:

In[7]:=
move1 != move2
Out[7]=

Neat Examples (1) 

Render high-resolution images on the GPU and observe the effect:

In[8]:=
img = ExampleData[{"TestImage", "House"}];
ResourceFunction["DeepDreamAlpha"][img, 25, TargetDevice -> "GPU", "StepSize" -> 0.1]
Out[8]=

Publisher

Aster Ctor (MoeNet)

Version History

  • 1.0.0 – 22 October 2019

Related Resources

License Information