Thursday, July 9, 2015

Deepdream: What do all the layers do?

I spent last night getting my computer prepped for some deep dreaming, and it left me thinking: What do all the different layers do? There's over a hundred to choose from, so why not iterate through them all and see what happens?

I used this as my starting point: https://github.com/Dhar/image-dreamer

My base picture is one I took from a plane out of Queenstown (munged version here), resized to 400px wide, and run through the layers as follows:


conv1/7x7_s2

pool1/3x3_s2

pool1/norm1
conv2/3x3_reduce
conv2/3x3
conv2/norm2
pool2/3x3_s2
inception_3a/1x1

inception_3a/3x3_reduce
inception_3a/3x3
inception_3a/5x5_reduce
inception_3a/5x5
inception_3a/pool
inception_3a/pool_proj
inception_3a/output
inception_3b/1x1
inception_3b/3x3_reduce
inception_3b/3x3
inception_3b/5x5_reduce
inception_3b/5x5
inception_3b/pool
inception_3b/pool_proj
inception_3b/output
pool3/3x3_s2
inception_4a/1x1
inception_4a/3x3_reduce
inception_4a/3x3
inception_4a/5x5_reduce
inception_4a/5x5
inception_4a/pool
inception_4a/pool_proj
inception_4a/output
inception_4b/1x1
inception_4b/3x3_reduce
inception_4b/3x3
inception_4b/5x5_reduce
inception_4b/5x5
inception_4b/pool
inception_4b/pool_proj
inception_4b/output
inception_4c/1x1
inception_4c/3x3_reduce
inception_4c/3x3
inception_4c/5x5_reduce
inception_4c/5x5
inception_4c/pool
inception_4c/pool_proj
inception_4c/output
inception_4d/1x1
inception_4d/3x3_reduce
inception_4d/3x3
inception_4d/5x5_reduce
inception_4d/5x5
inception_4d/pool
inception_4d/pool_proj
inception_4d/output
inception_4e/1x1
inception_4e/3x3_reduce
inception_4e/3x3
inception_4e/5x5_reduce
inception_4e/5x5
inception_4e/pool
inception_4e/pool_proj
inception_4e/output
pool4/3x3_s2
inception_5a/1x1
inception_5a/3x3_reduce
inception_5a/3x3
inception_5a/5x5_reduce
inception_5a/5x5
inception_5a/pool
inception_5a/pool_proj
inception_5a/output
inception_5b/1x1
inception_5b/3x3_reduce
inception_5b/3x3
inception_5b/5x5_reduce
inception_5b/5x5
inception_5b/pool
inception_5b/pool_proj
inception_5b/output

3 comments:

  1. is there an easy way to reference the layers? i want to be able to call each one in turn, but can't figure out how to reference them. net.blobs[n] doesn't work.

    ReplyDelete
  2. I want to use different layers than what the

    default is. Its defaulting me to Inception 4c.

    How would I go about changing to a different

    layer?

    "conv1/7x7_s2" "pool1/3x3_s2" "pool1/norm1"

    "conv2/3x3_reduce" "conv2/3x3" "conv2/norm2"

    "pool2/3x3_s2" "inception_3a/1x1"

    "inception_3a/3x3_reduce" "inception_3a/3x3"

    "inception_3a/5x5_reduce" "inception_3a/5x5"

    "inception_3a/pool" "inception_3a/pool_proj"

    "inception_3a/output" "inception_3b/1x1"

    "inception_3b/3x3_reduce" "inception_3b/3x3"

    "inception_3b/5x5_reduce" "inception_3b/5x5"

    "inception_3b/pool" "inception_3b/pool_proj"

    "inception_3b/output" "pool3/3x3_s2"

    "inception_4a/1x1" "inception_4a/3x3_reduce"

    "inception_4a/3x3" "inception_4a/5x5_reduce"

    "inception_4a/5x5" "inception_4a/pool"

    "inception_4a/pool_proj" "inception_4a/output"

    "inception_4b/1x1" "inception_4b/3x3_reduce"

    "inception_4b/3x3" "inception_4b/5x5_reduce"

    "inception_4b/5x5" "inception_4b/pool"

    "inception_4b/pool_proj" "inception_4b/output"

    "inception_4c/1x1" "inception_4c/3x3_reduce"

    "inception_4c/3x3" "inception_4c/5x5_reduce"

    "inception_4c/5x5" "inception_4c/pool"

    "inception_4c/pool_proj" "inception_4c/output"

    "inception_4d/1x1" "inception_4d/3x3_reduce"

    "inception_4d/3x3" "inception_4d/5x5_reduce"

    "inception_4d/5x5" "inception_4d/pool"

    "inception_4d/pool_proj" "inception_4d/output"

    "inception_4e/1x1" "inception_4e/3x3_reduce"

    "inception_4e/3x3" "inception_4e/5x5_reduce"

    "inception_4e/5x5" "inception_4e/pool"

    "inception_4e/pool_proj" "inception_4e/output"

    "pool4/3x3_s2" "inception_5a/1x1"

    "inception_5a/3x3_reduce" "inception_5a/3x3"

    "inception_5a/5x5_reduce" "inception_5a/5x5"

    "inception_5a/pool" "inception_5a/pool_proj"

    "inception_5a/output" "inception_5b/1x1"

    "inception_5b/3x3_reduce" "inception_5b/3x3"

    "inception_5b/5x5_reduce" "inception_5b/5x5"

    "inception_5b/pool" "inception_5b/pool_proj"

    "inception_5b/output" "pool5/7x7_s1"

    "pool5/drop_7x7_s1" "loss3/classifier" "prob"


    pop one of those in place of

    "inception_4c/output"

    in dreamify.py

    ReplyDelete
  3. I want to use different layers than what the

    default is. Its defaulting me to Inception 4c.

    How would I go about changing to a different

    layer?

    "conv1/7x7_s2" "pool1/3x3_s2" "pool1/norm1"

    "conv2/3x3_reduce" "conv2/3x3" "conv2/norm2"

    "pool2/3x3_s2" "inception_3a/1x1"

    "inception_3a/3x3_reduce" "inception_3a/3x3"

    "inception_3a/5x5_reduce" "inception_3a/5x5"

    "inception_3a/pool" "inception_3a/pool_proj"

    "inception_3a/output" "inception_3b/1x1"

    "inception_3b/3x3_reduce" "inception_3b/3x3"

    "inception_3b/5x5_reduce" "inception_3b/5x5"

    "inception_3b/pool" "inception_3b/pool_proj"

    "inception_3b/output" "pool3/3x3_s2"

    "inception_4a/1x1" "inception_4a/3x3_reduce"

    "inception_4a/3x3" "inception_4a/5x5_reduce"

    "inception_4a/5x5" "inception_4a/pool"

    "inception_4a/pool_proj" "inception_4a/output"

    "inception_4b/1x1" "inception_4b/3x3_reduce"

    "inception_4b/3x3" "inception_4b/5x5_reduce"

    "inception_4b/5x5" "inception_4b/pool"

    "inception_4b/pool_proj" "inception_4b/output"

    "inception_4c/1x1" "inception_4c/3x3_reduce"

    "inception_4c/3x3" "inception_4c/5x5_reduce"

    "inception_4c/5x5" "inception_4c/pool"

    "inception_4c/pool_proj" "inception_4c/output"

    "inception_4d/1x1" "inception_4d/3x3_reduce"

    "inception_4d/3x3" "inception_4d/5x5_reduce"

    "inception_4d/5x5" "inception_4d/pool"

    "inception_4d/pool_proj" "inception_4d/output"

    "inception_4e/1x1" "inception_4e/3x3_reduce"

    "inception_4e/3x3" "inception_4e/5x5_reduce"

    "inception_4e/5x5" "inception_4e/pool"

    "inception_4e/pool_proj" "inception_4e/output"

    "pool4/3x3_s2" "inception_5a/1x1"

    "inception_5a/3x3_reduce" "inception_5a/3x3"

    "inception_5a/5x5_reduce" "inception_5a/5x5"

    "inception_5a/pool" "inception_5a/pool_proj"

    "inception_5a/output" "inception_5b/1x1"

    "inception_5b/3x3_reduce" "inception_5b/3x3"

    "inception_5b/5x5_reduce" "inception_5b/5x5"

    "inception_5b/pool" "inception_5b/pool_proj"

    "inception_5b/output" "pool5/7x7_s1"

    "pool5/drop_7x7_s1" "loss3/classifier" "prob"


    pop one of those in place of

    "inception_4c/output"

    in dreamify.py

    ReplyDelete