Пример #1
0
    def test_graph_parameters(self):
        np.random.seed(0)
        net1 = Vector(10) >> Full(10)

        net2 = net1 >> Full(10)

        self.assertEqual(net1.get_state(), net2.left.get_state())
Пример #2
0
    def test_graph_parameters(self):
        np.random.seed(0)
        net1 = Vector(10) >> Full(10)

        net2 = net1 >> Full(10)

        self.assertEqual(net1.get_state(), net2.left.get_state())
Пример #3
0
    def test_freeze_parameters(self):
        np.random.seed(0)
        net1 = Vector(10) >> Linear(10)
        net1.initialize()

        self.assertEqual(net1.freeze().get_state(as_list=True),
                         net1.get_state(as_list=True))
Пример #4
0
    def test_graph_parameters(self):
        np.random.seed(0)
        net1 = Vector(10) >> Linear(10)

        net2 = net1 >> Linear(10)

        self.assertEqual(net1.get_state(as_list=True), net2.left.get_state(as_list=True))
Пример #5
0
    def test_graph_parameters(self):
        np.random.seed(0)
        net1 = Vector(10) >> Linear(10)

        net2 = net1 >> Linear(10)

        self.assertEqual(net1.get_state(as_list=True),
                         net2.left.get_state(as_list=True))
Пример #6
0
    def test_freeze_parameters(self):
        np.random.seed(0)
        net1 = Vector(10) >> Full(10)

        self.assertEqual(net1.freeze().get_state(), net1.get_state())
Пример #7
0
 def test_freeze(self):
     net1 = Vector(10) >> Full(10)
     self.assertEqual(Freeze(net1).get_state(), net1.get_state())
     self.assertEqual(Freeze(net1).get_parameters(), [])
Пример #8
0
    def test_freeze_parameters(self):
        np.random.seed(0)
        net1 = Vector(10) >> Full(10)

        self.assertEqual(net1.freeze().get_state(), net1.get_state())
Пример #9
0
 def test_freeze(self):
     net1 = Vector(10) >> Full(10)
     self.assertEqual(Freeze(net1).get_state(), net1.get_state())
     self.assertEqual(Freeze(net1).get_parameters(), [])
Пример #10
0
    def test_freeze_parameters(self):
        np.random.seed(0)
        net1 = Vector(10) >> Linear(10)
        net1.initialize()

        self.assertEqual(net1.freeze().get_state(as_list=True), net1.get_state(as_list=True))