Replies: 1 comment
-
Hello, Very good catch, thank you for pointing this out -- this is definitely a mistake/typo in the tutorial as this looks like syntax we have there reflects an earlier iteration of ngc-learn. Your fix makes sense, as the .step() function should only return one single object, the "delta" object containing the synaptic adjustments one could use with an external (TF) optimizer like SGD or Adam. Technically, now, if you git pull the most recent version of ngc-learn (which is stable), you don't even need the
You should also be able to run the circuit1.py example with the above code snippet ]if you are using the bleeding-edge version of ngc-learn (though this might work fine for the version you might be working with) by setting We have now corrected tutorial # 1 to no longer yield the error you found (in the current main repo branch)! Also glad to hear you are enjoying the tutorial for ngc-learn. Hopefully it will help in utilizing ngc-learn's power to build your own systems and models! |
Beta Was this translation helpful? Give feedback.
-
Hi, I am really enjoying the first lesson!
Got an error in the "circuit1.py" section:
1-for k in range(K):
2-- values, _ = circuit.step(calc_delta=False)
3-- circuit.parse_node_values(values)
4-- b_val = circuit.extract("b","z")
5-- print(" t({}) => Value of b.phi(z) = {}".format(k, b_val.numpy()))
second line produces error:
TypeError: cannot unpack non-iterable NoneType object
I set calc_delta to True and removed the ', _' after 'values' (on line 2):
2-- values = circuit.step(calc_delta=True)
and got the desired output.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions