Skip to content

Commit

Permalink
Update tutorial_learning2learn.py
Browse files Browse the repository at this point in the history
  • Loading branch information
KetpuntoG committed Sep 12, 2023
1 parent c753577 commit b7bd0ea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions demonstrations/tutorial_learning2learn.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def hamiltonian(params, **kwargs):

# Since we use only one layer in QAOA, params have the shape 1 x 2,
# in the form [[alpha, gamma]].
x = tf.Variable([[0.5], [0.5]], dtype=tf.float32)
x = tf.Variable([[0.5], [0.5]], dtype=tf.float64)

# Evaluate th QAOA instance just created with some angles.
print(cost(x))
Expand Down Expand Up @@ -546,7 +546,7 @@ def train_step(graph_cost):
#

# Parameters are randomly initialized
x = tf.Variable(np.random.rand(2, 1))
x = tf.Variable(np.random.rand(2, 1), dtype=tf.float64)

# We set the optimizer to be a Stochastic Gradient Descent
opt = tf.keras.optimizers.SGD(learning_rate=0.01)
Expand Down

0 comments on commit b7bd0ea

Please sign in to comment.