You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I am learning how to use nengo and I think that the use of implicit time argument should be explained in the documentation of Node because it is non-trivial. I found these cases in a solved issue (#212), i don't know if it is completely correct, but help me to understand.
# Case 1: constant
n = nengo.Node([0,0,0])
nengo.Connection(n, b, fiter=None)
# Case 2: time-varying
def my_function(t):
return np.sin(t)
n = nengo.Node(my_function)
nengo.Connection(n, b, filter=None)
# Case 3: time-and-state-varying
def my_function(t, x):
return np.sin(t*x)
n = nengo.Node(my_function, dimensions=1)
nengo.Connection(a, n, filter=None)
nengo.Connection(n, b, filter=None)
Thank you!
The text was updated successfully, but these errors were encountered:
Thanks @IgnacioRubioScola, this is a good suggestion to add these details to the documentation. We've added this issue to our backlog, and plan to do this as part of the Nengo 4.0 release.
I think you've got the general idea correct. The one thing I noticed is that you've used dimensions instead of the correct size_in to set the size of your Node (we do this because a Node can have an input size that is different from its output size).
To summarize, node functions always take the simulation time t as the first input. If the node has a size_in != None then the function must also have a second argument x, which is the vector coming in to the node at the current time (the size of the vector equals size_in).
Hi,
I am learning how to use nengo and I think that the use of implicit time argument should be explained in the documentation of Node because it is non-trivial. I found these cases in a solved issue (#212), i don't know if it is completely correct, but help me to understand.
Thank you!
The text was updated successfully, but these errors were encountered: