<div dir="ltr"><div><div>Thank you Terry. I am really grateful.<br></div>But , unfortunately I cannot even find function as one of the parameters of the node, do you have some examples I can follow to get better experience with NENGO?<br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 8, 2016 at 8:02 PM, Terry Stewart <span dir="ltr"><<a href="mailto:terry.stewart@gmail.com" target="_blank">terry.stewart@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You should be able to do that with the node, since the return value<br>
from that node is the input to b. x[0] is the output of a.neurons[0],<br>
and so if your return value's [0] element is just based on x[0], then<br>
the input to b.neurons[0] will be based only on the output from<br>
a.neurons[0].<br>
<span class="HOEnZb"><font color="#888888"><br>
Terry<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Mon, Aug 8, 2016 at 1:56 PM, Omar Zahra <<a href="mailto:omar.zahra@ejust.edu.eg">omar.zahra@ejust.edu.eg</a>> wrote:<br>
> yes , that's exactly what I wanted to do. Using node would solve my problem.<br>
> The only remaining point is now the input to the node is some firing rate<br>
> (x) , I want for example b.neurons[0] to have an output depending on input<br>
> from a.neurons[0] ONLY.<br>
><br>
> On Mon, Aug 8, 2016 at 7:45 PM, Terry Stewart <<a href="mailto:terry.stewart@gmail.com">terry.stewart@gmail.com</a>><br>
> wrote:<br>
>><br>
>> Hmm, I'm still not quite sure what you're trying to do here. What do<br>
>> you mean by a "function for the rate of spikes"? Do you mean neuron<br>
>> model itself (i.e. the thing that takes input current and generates<br>
>> spikes)? If so, that's already part of the Ensemble and is specified<br>
>> by the neuron_type parameter, and you can choose from LIF, LIFRate,<br>
>> Izhikevich, Sigmoid, or write your own. Or do you want to do<br>
>> something to the spikes after they've been generated by the neurons<br>
>> and before they're fed to the next group of neurons? What sort of<br>
>> thing are you envisioning here?<br>
>><br>
>> That said, in general, you can implement anything you want in Nengo by<br>
>> creating a Node:<br>
>><br>
>> -------------------<br>
>> import nengo<br>
>><br>
>> model = nengo.Network()<br>
>> with model:<br>
>> a = nengo.Ensemble(n_neurons=50, dimensions=1)<br>
>> b = nengo.Ensemble(n_neurons=50, dimensions=1)<br>
>><br>
>> def func(t, x):<br>
>> # do whatever you want in here, where x is the input spikes and<br>
>> # you return the output activity<br>
>> return x<br>
>> mynode = nengo.Node(func, size_in=50, size_out=50)<br>
>><br>
>> nengo.Connection(a.neurons, mynode)<br>
>> nengo.Connection(mynode, b.neurons)<br>
>> ----------------------<br>
>><br>
>><br>
>> I'm still not sure whether that's what you're looking for, however....<br>
>><br>
>><br>
>> Terry<br>
>><br>
>> On Mon, Aug 8, 2016 at 1:34 PM, Omar Zahra <<a href="mailto:omar.zahra@ejust.edu.eg">omar.zahra@ejust.edu.eg</a>><br>
>> wrote:<br>
>> > This part I couldn't actually understand from the documentation well. I<br>
>> > thought that It wasn't about getting "the optimal connection weights" ,<br>
>> > I<br>
>> > just wanted to apply some function for the rate of spikes, and the<br>
>> > output<br>
>> > from the function would be input tp the postsynaptic.<br>
>> > Sorry for that misunderstanding , how then would I apply some function<br>
>> > to<br>
>> > the rate of spike ?<br>
>> > Thanks for your patience<br>
>> ><br>
>> > On Mon, Aug 8, 2016 at 6:04 PM, Terry Stewart <<a href="mailto:terry.stewart@gmail.com">terry.stewart@gmail.com</a>><br>
>> > wrote:<br>
>> >><br>
>> >> I think the problem is that you're trying to specify a function as<br>
>> >> well. What function are you trying to do?<br>
>> >><br>
>> >> The problem is that you're specifying the connection weights in two<br>
>> >> different ways. When you save function=something, Nengo uses that<br>
>> >> function to find the optimal connection weights to approximate that<br>
>> >> function. So you can't also manually specify the connection weights,<br>
>> >> since that's exactly what you've told nengo to solve for on its own!<br>
>> >><br>
>> >> Terry<br>
>> >><br>
>> >> On Mon, Aug 8, 2016 at 12:00 PM, Omar Zahra <<a href="mailto:omar.zahra@ejust.edu.eg">omar.zahra@ejust.edu.eg</a>><br>
>> >> wrote:<br>
>> >> > Hello Terry,<br>
>> >> ><br>
>> >> > Thanks for your reply. I already used this to make a connection.<br>
>> >> > My problem is that I cannot " nengo.Connection(a.neurons, b.neurons,<br>
>> >> > transform=matrix, function = func)" because it must be applied to an<br>
>> >> > Ensemble.<br>
>> >> > I hope you have some solution for this problem.<br>
>> >> ><br>
>> >> > On Mon, Aug 8, 2016 at 5:47 PM, Terry Stewart<br>
>> >> > <<a href="mailto:terry.stewart@gmail.com">terry.stewart@gmail.com</a>><br>
>> >> > wrote:<br>
>> >> >><br>
>> >> >> Hello Omar,<br>
>> >> >><br>
>> >> >> If you want to use Nengo to do manual neuron-to-neuron connection<br>
>> >> >> (i.e. the sort of thing that would happen in a standard neural<br>
>> >> >> simulator), then you need to connection to the ens.neurons object.<br>
>> >> >> For example, here's a quick way to do random connections between two<br>
>> >> >> groups of neurons:<br>
>> >> >><br>
>> >> >> --------------<br>
>> >> >> import nengo<br>
>> >> >> import numpy as np<br>
>> >> >><br>
>> >> >> model = nengo.Network()<br>
>> >> >> with model:<br>
>> >> >> a = nengo.Ensemble(n_neurons=50, dimensions=1)<br>
>> >> >> b = nengo.Ensemble(n_neurons=50, dimensions=1)<br>
>> >> >><br>
>> >> >> matrix = np.random.normal(size=(50, 50))<br>
>> >> >> nengo.Connection(a.neurons, b.neurons, transform=matrix)<br>
>> >> >> -------------------------<br>
>> >> >><br>
>> >> >> Let us know if that helps for your situations!<br>
>> >> >><br>
>> >> >> Also, for future questions, we've just started up an online forum at<br>
>> >> >> <a href="https://forum.nengo.ai/" rel="noreferrer" target="_blank">https://forum.nengo.ai/</a><br>
>> >> >><br>
>> >> >> Terry<br>
>> >> >><br>
>> >> >> On Mon, Aug 8, 2016 at 9:13 AM, Omar Zahra <<a href="mailto:omar.zahra@ejust.edu.eg">omar.zahra@ejust.edu.eg</a>><br>
>> >> >> wrote:<br>
>> >> >> > Hello,<br>
>> >> >> ><br>
>> >> >> > I am new to NENGO and also just started using python to deal with<br>
>> >> >> > NENGO.<br>
>> >> >> > I<br>
>> >> >> > would like to build part of the brain by connecting some layers.<br>
>> >> >> > These<br>
>> >> >> > connections are supposed to be topological. I would like also to<br>
>> >> >> > apply<br>
>> >> >> > some<br>
>> >> >> > function across these connections. When I try to use connection to<br>
>> >> >> > the<br>
>> >> >> > whole<br>
>> >> >> > ensemble, I cannot define the connections perfectly as done in<br>
>> >> >> > case<br>
>> >> >> > of<br>
>> >> >> > making connections neuron by neuron -using Ensemble.neurons[] -. I<br>
>> >> >> > tried<br>
>> >> >> > even increasing the dimensions of the ensemble and setting the<br>
>> >> >> > encoders<br>
>> >> >> > such<br>
>> >> >> > as to give seperate action for each neuron, still some unintended<br>
>> >> >> > response<br>
>> >> >> > appears.<br>
>> >> >> > Reply ASAP please. Thanks in advance<br>
>> >> >> ><br>
>> >> >> > --<br>
>> >> >> > Best Regards<br>
>> >> >> > Omar Ibn ElKhatab AbdAllah Zahra<br>
>> >> >> ><br>
>> >> >> > ______________________________<wbr>_________________<br>
>> >> >> > nengo-user mailing list<br>
>> >> >> > <a href="mailto:nengo-user@ctnsrv.uwaterloo.ca">nengo-user@ctnsrv.uwaterloo.ca</a><br>
>> >> >> > <a href="http://ctnsrv.uwaterloo.ca/mailman/listinfo/nengo-user" rel="noreferrer" target="_blank">http://ctnsrv.uwaterloo.ca/<wbr>mailman/listinfo/nengo-user</a><br>
>> >> >> ><br>
>> >> ><br>
>> >> ><br>
>> >> ><br>
>> >> ><br>
>> >> > --<br>
>> >> > Best Regards<br>
>> >> > Omar Ibn ElKhatab AbdAllah Zahra<br>
>> ><br>
>> ><br>
>> ><br>
>> ><br>
>> > --<br>
>> > Best Regards<br>
>> > Omar Ibn ElKhatab AbdAllah Zahra<br>
><br>
><br>
><br>
><br>
> --<br>
> Best Regards<br>
> Omar Ibn ElKhatab AbdAllah Zahra<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Best Regards<div>Omar Ibn ElKhatab AbdAllah Zahra</div></div></div>
</div>