-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Open
Description
Referring to the notebook:
In the following code portion (8th code block of the notebook):
`# Optimization process.
def run_optimization(x):
# Wrap computation inside a GradientTape for automatic differentiation.
with tf.GradientTape() as g:
reconstructed_image = decoder(encoder(x))
loss = mean_square(reconstructed_image, x)
# Variables to update, i.e. trainable variables.
trainable_variables = weights.values() + biases.values()
# Compute gradients.
gradients = g.gradient(loss, trainable_variables)
# Update W and b following gradients.
optimizer.apply_gradients(zip(gradients, trainable_variables))
return loss`
the line:
trainable_variables = weights.values() + biases.values()
results to me in an error due to the impossibility of summing two python dict_values. I personally solved the issue by converting both dict_values to lists:
trainable_variables = list(weights.values()) + list(biases.values())
I hope my issue is of utility for this great repo! Thank you for the work
gpendrys
Metadata
Metadata
Assignees
Labels
No labels