[nengo-user] trouble generating scripts/simpleNode question
Brian Krainer
bkrainer731 at gmail.com
Fri May 30 15:46:13 EDT 2014
Thanks, that was very helpful!
How would this be done in the more complex BG models such as sequencerouted.py? I see there is an Input class but I'm not really sure how to include arbitrary code with that. Any tips?
Thank you,
Brian
> On May 30, 2014, at 3:31 PM, Terry Stewart <terry.stewart at gmail.com> wrote:
>
> Hi Brian,
>
> We're still working on fixing the generate script bug you pointed out,
> but in the meantime I thought I'd take a quick look at the second
> question. :)
>
> You're right it's not clear how to do this... the trick is that you
> have to give the origin on your SimpleNode a particular name "X", and
> then it works fine. Here's an example:
>
> -----------------------------
> import nef
> import nps
>
> net=nef.Network('Basal Ganglia')
>
> class MyNode(nef.SimpleNode):
> def origin_X(self): # this is what the origin must be called
> return [0.5, 0.9, 0.5, 0.5, 0.5]
>
> input = net.add(MyNode('input'))
>
> net.make('output',1,3,mode='direct')
>
> nps.basalganglia.make_basal_ganglia(net,'input','output', 3, same_neurons=False,
> neurons=50)
>
> net.add_to_nengo()
> net.view()
> -------------------------
>
> let me know if that works for you!
>
> Terry
>
>> On Thu, May 29, 2014 at 1:37 PM, Brian Krainer <bkrainer731 at gmail.com> wrote:
>> Hello,
>>
>> I've got 2 questions:
>>
>> 1)I'm trying to use 'generate script' with models that I've made using the
>> GUI. Sometimes it works fine, but other times I get the error:
>>
>> "Could not perform action: java.lang.ClassCastException: java.lang.Integer
>> cannot be cast to java.lang.Double"
>>
>> I thought maybe there was something wrong with the way I was connecting
>> things in the network, so I loaded one of the examples from the 'demo'
>> directory (basalganglia.py) and tried to generate the script. This gave me
>> the same error. Why is this the case?
>>
>> 2) Is it possible to use a simpleNode class to define a function that is
>> input to the Basal Ganglia network? I can't seem to figure out the correct
>> syntax if it is possible.
>>
>> Thanks,
>> Brian
>>
>> _______________________________________________
>> nengo-user mailing list
>> nengo-user at ctnsrv.uwaterloo.ca
>> http://ctnsrv.uwaterloo.ca/mailman/listinfo/nengo-user
>>
More information about the nengo-user
mailing list