Beispiel #1
0
    def setUpClass(cls):
        """
        Compile the network for this test
        """
        neuron = Neuron(equations="r = 1")

        neuron2 = Neuron(equations="r = sum(exc)")

        pop1 = Population((3, 3), neuron)
        pop2 = Population((3, 3), neuron2)

        proj1 = Projection(pre=pop1, post=pop2, target="exc")
        proj2 = Projection(pre=pop1, post=pop2, target="exc")
        proj3 = Projection(pre=pop1, post=pop2, target="exc")

        proj1.connect_one_to_one(weights=0.1)
        proj2.connect_all_to_all(weights=0.1)
        proj3.connect_fixed_number_pre(3, weights=0.1)

        cls.test_net = Network()
        cls.test_net.add([pop1, pop2, proj1, proj2, proj3])
        cls.test_net.compile(silent=True)

        cls.test_proj1 = cls.test_net.get(proj1)
        cls.test_proj2 = cls.test_net.get(proj2)
        cls.test_proj3 = cls.test_net.get(proj3)
Beispiel #2
0
    def setUpClass(cls):
        """
        Compile the network for this test
        """
        neuron = Neuron(
            equations="r = 1"
        )

        neuron2 = Neuron(
            equations="r = sum(exc)"
        )

        pop1 = Population((3, 3), neuron)
        pop2 = Population((3, 3), neuron2)

        proj1 = Projection(pre=pop1, post=pop2, target="exc")
        proj2 = Projection(pre=pop1, post=pop2, target="exc")
        proj3 = Projection(pre=pop1, post=pop2, target="exc")

        proj1.connect_one_to_one(weights=0.1)
        proj2.connect_all_to_all(weights=0.1)
        proj3.connect_fixed_number_pre(3, weights=0.1)

        cls.test_net = Network()
        cls.test_net.add([pop1, pop2, proj1, proj2, proj3])
        cls.test_net.compile(silent=True)

        cls.test_proj1 = cls.test_net.get(proj1)
        cls.test_proj2 = cls.test_net.get(proj2)
        cls.test_proj3 = cls.test_net.get(proj3)
    def setUpClass(cls):
        """
        Compile the network for this test
        """
        neuron = Neuron(parameters="r=0.0")

        out1 = Neuron(equations="""
                r =  sum(one2one)
            """)

        out2 = Neuron(equations="""
                r =  sum(all2all) + sum(fnp)
            """)

        pop1 = Population((17, 17), neuron)
        pop2 = Population((17, 17), out1)
        pop3 = Population(4, out2)

        proj = Projection(pre=pop1, post=pop2, target="one2one")
        proj.connect_one_to_one(
            weights=0.0,
            force_multiple_weights=True)  # weights set in the test

        proj2 = Projection(pre=pop1, post=pop3, target="all2all")
        proj2.connect_all_to_all(weights=Uniform(0, 1))

        proj3 = Projection(pre=pop1, post=pop3, target="fnp")
        proj3.connect_fixed_number_pre(5, weights=Uniform(0, 1))

        cls.test_net = Network()
        cls.test_net.add([pop1, pop2, pop3, proj, proj2, proj3])
        cls.test_net.compile(silent=True)

        cls.net_pop1 = cls.test_net.get(pop1)
        cls.net_pop2 = cls.test_net.get(pop2)
        cls.net_pop3 = cls.test_net.get(pop3)
        cls.net_proj = cls.test_net.get(proj)
        cls.net_proj2 = cls.test_net.get(proj2)
        cls.net_proj3 = cls.test_net.get(proj3)