Skip to content

Commit

Permalink
Update opt.minimize args
Browse files Browse the repository at this point in the history
  • Loading branch information
mudit2812 committed Aug 30, 2023
1 parent 71d6d3a commit 6a8a897
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions demonstrations/tutorial_QGAN.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def gen_cost(gen_weights):
cost = lambda: disc_cost(disc_weights)

for step in range(50):
opt.minimize(cost, disc_weights)
opt.minimize(cost, [disc_weights])
if step % 5 == 0:
cost_val = cost().numpy()
print("Step {}: cost = {}".format(step, cost_val))
Expand Down Expand Up @@ -243,7 +243,7 @@ def gen_cost(gen_weights):
cost = lambda: gen_cost(gen_weights)

for step in range(50):
opt.minimize(cost, gen_weights)
opt.minimize(cost, [gen_weights])
if step % 5 == 0:
cost_val = cost().numpy()
print("Step {}: cost = {}".format(step, cost_val))
Expand Down

0 comments on commit 6a8a897

Please sign in to comment.