Example #1
0
    def generate_connection_e(self, params):
        """
        Generate the W_eu connection matrix. TODO: params should not be passed
        as an argument again!

        Arguments:
        params -- bunch of simulation parameters from param.py

        Returns:
        W_eu -- FullSynapticMatrix of size (N_e, A), containing 1s and 0s
        """

        # choose random, non-overlapping input neuron pools
        W = np.zeros((self.N_e, self.A))
        available = set(range(self.N_e))
        for a in range(self.A):
            temp = random.sample(available, self.N_u)
            W[temp, a] = 1
            available = set([n for n in available if n not in temp])
            assert len(available) > 0,\
                   'Input alphabet too big for non-overlapping neurons'

        # always use a full synaptic matrix
        ans = synapses.FullSynapticMatrix(params, (self.N_e, self.A))
        ans.W = W

        return ans
Example #2
0
    def generate_connection_e(self, par):
        """Generate the W_eu connection matrix

        Parameters:
            par: Bunch
                Main initial sorn parameters
        """
        # use a full synaptic matrix
        ans = synapses.FullSynapticMatrix(par, (par.N_e, self.N_u))
        ans.W = np.zeros(par.N_e)

        return ans
Example #3
0
    def generate_connection_e(self, par):
        """
        Generate the W_eu connection matrix

        Parameters:
            N_e: number of excitatory neurons
        """

        # choose random, overlapping input neuron pools
        W = np.zeros((par.N_e, self.N_a))
        available = set(range(par.N_e))
        # TODO: be sure that the input pools are not equal - random.choice
        for a in range(self.N_a):
            temp = random.sample(available, self.N_u)
            W[temp, a] = 1

        # always use a full synaptic matrix
        ans = synapses.FullSynapticMatrix(par, (par.N_e, self.N_a))
        ans.W = W

        return ans
Example #4
0
    def generate_connection_e(self, par):
        """Generate the W_eu connection matrix

        Parameters:
            par: Bunch
                Main initial sorn parameters
        """
        # choose random input neuron pools
        W = np.zeros((par.N_e, self.N_a))
        available = set(range(par.N_e))
        for a in range(self.N_a):
            temp = random.sample(available, self.N_u)
            W[temp, a] = 1
            if not self.overlap:
                available -= set(temp)

        # always use a full synaptic matrix
        ans = synapses.FullSynapticMatrix(par, (par.N_e, self.N_a))
        ans.W = W

        return ans