Skip to content

Reshape incorrect for Style Transfer #1

@TimoFriedri

Description

@TimoFriedri

Hi,

I used your code coming from this article:
towardsdatascience

In your Notebook "Neural Style Transfer.ipynb" you have the following lines:

a_S = tf.reshape(a_S, [n_C, n_H * n_W])
 a_G = tf.reshape(a_G, [n_C, n_H * n_W])

This is the same mistake I did.
I think it has to be like this, otherwise you wildly mix values from the activation channels.

a_S = tf.transpose(tf.reshape(a_S, [n_H * n_W, n_C ]))
 a_G = tf.transpose(tf.reshape(a_G, [n_H * n_W, n_C ]))

This is because n_H and n_W come before n_C in a_S and A_G. This is crucial.
I made the same mistake in another setup.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions