[nengo-user] Adjusting topological connections

Terry Stewart terry.stewart at gmail.com
Mon Aug 8 13:45:15 EDT 2016


Hmm, I'm still not quite sure what you're trying to do here.  What do
you mean by a "function for the rate of spikes"?  Do you mean neuron
model itself (i.e. the thing that takes input current and generates
spikes)?  If so, that's already part of the Ensemble and is specified
by the neuron_type parameter, and you can choose from LIF, LIFRate,
Izhikevich, Sigmoid, or write your own.  Or do you want to do
something to the spikes after they've been generated by the neurons
and before they're fed to the next group of neurons?  What sort of
thing are you envisioning here?

That said, in general, you can implement anything you want in Nengo by
creating a Node:

-------------------
import nengo

model = nengo.Network()
with model:
    a = nengo.Ensemble(n_neurons=50, dimensions=1)
    b = nengo.Ensemble(n_neurons=50, dimensions=1)

    def func(t, x):
        # do whatever you want in here, where x is the input spikes and
        # you return the output activity
        return x
    mynode = nengo.Node(func, size_in=50, size_out=50)

    nengo.Connection(a.neurons, mynode)
    nengo.Connection(mynode, b.neurons)
----------------------


I'm still not sure whether that's what you're looking for, however....


Terry

On Mon, Aug 8, 2016 at 1:34 PM, Omar Zahra <omar.zahra at ejust.edu.eg> wrote:
> This part I couldn't actually understand from the documentation well. I
> thought that It wasn't about getting "the optimal connection weights" , I
> just wanted to apply some function for the rate of spikes, and the output
> from the function would be input tp the postsynaptic.
> Sorry for that misunderstanding , how then would I apply some function to
> the rate of spike ?
> Thanks for your patience
>
> On Mon, Aug 8, 2016 at 6:04 PM, Terry Stewart <terry.stewart at gmail.com>
> wrote:
>>
>> I think the problem is that you're trying to specify a function as
>> well.  What function are you trying to do?
>>
>> The problem is that you're specifying the connection weights in two
>> different ways.  When you save function=something, Nengo uses that
>> function to find the optimal connection weights to approximate that
>> function.  So you can't also manually specify the connection weights,
>> since that's exactly what you've told nengo to solve for on its own!
>>
>> Terry
>>
>> On Mon, Aug 8, 2016 at 12:00 PM, Omar Zahra <omar.zahra at ejust.edu.eg>
>> wrote:
>> > Hello Terry,
>> >
>> > Thanks for your reply. I already used this to make a connection.
>> > My problem is that I cannot " nengo.Connection(a.neurons, b.neurons,
>> > transform=matrix, function = func)" because it must be applied to an
>> > Ensemble.
>> > I hope you have some solution for this problem.
>> >
>> > On Mon, Aug 8, 2016 at 5:47 PM, Terry Stewart <terry.stewart at gmail.com>
>> > wrote:
>> >>
>> >> Hello Omar,
>> >>
>> >> If you want to use Nengo to do manual neuron-to-neuron connection
>> >> (i.e. the sort of thing that would happen in a standard neural
>> >> simulator), then you need to connection to the ens.neurons object.
>> >> For example, here's a quick way to do random connections between two
>> >> groups of neurons:
>> >>
>> >> --------------
>> >> import nengo
>> >> import numpy as np
>> >>
>> >> model = nengo.Network()
>> >> with model:
>> >>     a = nengo.Ensemble(n_neurons=50, dimensions=1)
>> >>     b = nengo.Ensemble(n_neurons=50, dimensions=1)
>> >>
>> >>     matrix = np.random.normal(size=(50, 50))
>> >>     nengo.Connection(a.neurons, b.neurons, transform=matrix)
>> >> -------------------------
>> >>
>> >> Let us know if that helps for your situations!
>> >>
>> >> Also, for future questions, we've just started up an online forum at
>> >> https://forum.nengo.ai/
>> >>
>> >> Terry
>> >>
>> >> On Mon, Aug 8, 2016 at 9:13 AM, Omar Zahra <omar.zahra at ejust.edu.eg>
>> >> wrote:
>> >> > Hello,
>> >> >
>> >> > I am new to NENGO and also just started using python to deal with
>> >> > NENGO.
>> >> > I
>> >> > would like to build part of the brain by connecting some layers.
>> >> > These
>> >> > connections are supposed to be topological. I would like also to
>> >> > apply
>> >> > some
>> >> > function across these connections. When I try to use connection to
>> >> > the
>> >> > whole
>> >> > ensemble, I cannot define the connections perfectly as done in case
>> >> > of
>> >> > making connections neuron by neuron -using Ensemble.neurons[] -. I
>> >> > tried
>> >> > even increasing the dimensions of the ensemble and setting the
>> >> > encoders
>> >> > such
>> >> > as to give seperate action for each neuron, still some unintended
>> >> > response
>> >> > appears.
>> >> > Reply ASAP please. Thanks in advance
>> >> >
>> >> > --
>> >> > Best Regards
>> >> > Omar Ibn ElKhatab AbdAllah Zahra
>> >> >
>> >> > _______________________________________________
>> >> > nengo-user mailing list
>> >> > nengo-user at ctnsrv.uwaterloo.ca
>> >> > http://ctnsrv.uwaterloo.ca/mailman/listinfo/nengo-user
>> >> >
>> >
>> >
>> >
>> >
>> > --
>> > Best Regards
>> > Omar Ibn ElKhatab AbdAllah Zahra
>
>
>
>
> --
> Best Regards
> Omar Ibn ElKhatab AbdAllah Zahra



More information about the nengo-user mailing list