Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Disable weight update for the vgg parameters #2990

Merged
merged 4 commits into from
Feb 10, 2020

Conversation

abhishekpratapa
Copy link
Collaborator

Overview

All the parameters were being trained in the TF style transfer implementation. Only the Transformer network needed to be trained.

Previous Results

latest_400
latest_300
latest_200

New Results

latest_5000
latest_6400
latest_6300

tensorflow_variables[key] = _tf.Variable(
initial_value=_utils.convert_conv2d_coreml_to_tf(net_params[key]),
name=key,
trainable=trainable,
trainable=train_param,
Copy link
Collaborator

@shreyajain17 shreyajain17 Feb 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the transformer layer? Why is trainable parameter switching between True and False for it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So trainable specifies if the convolutional layers of the transformer network are trainable or not. The instance normalization layers are always trainable whereas the convolutional layers of the vgg network should never be trainable. Since the vgg network only contains convolutional layers. and the only other network that contains convolutional layers is the transformer network, this split works.

Returns
-------
out: dict
The TF Variable dictionary.
"""
tensorflow_variables = dict()
for key in net_params.keys():
if "weight" in key:
if "conv" in key:
if 'weight' in key:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we going back to single quotes here? Are not using the new formatter/linter?

@abhishekpratapa abhishekpratapa merged commit 43ee1d1 into apple:master Feb 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants