예제 #1
0
 def test_clonelayer(self):
     """Test a simple clonelayer with three SFA Nodes."""
     sfa_node = SFABiNode(input_dim=3, output_dim=2)
     clonelayer = CloneBiLayer(sfa_node, 3)
     x = n.random.random((100,9))
     clonelayer.train(x)
     clonelayer.stop_training()
     clonelayer.execute(x)
예제 #2
0
 def test_clonelayer(self):
     """Test a simple clonelayer with three SFA Nodes."""
     sfa_node = SFABiNode(input_dim=3, output_dim=2)
     clonelayer = CloneBiLayer(sfa_node, 3)
     x = n.random.random((100,9))
     clonelayer.train(x)
     clonelayer.stop_training()
     clonelayer.execute(x)
예제 #3
0
 def test_use_copies_msg(self):
     """Test the correct reaction to an outgoing use_copies message."""
     stop_result = ({"clonelayer" + MSG_ID_SEP + "use_copies": True}, 1)
     stop_sfa_node = SFABiNode(stop_result=stop_result,
                               input_dim=10, output_dim=3)
     clonelayer = CloneBiLayer(node=stop_sfa_node,
                               n_nodes=3,
                               use_copies=False,
                               node_id="clonelayer")
     x = n.random.random((100,30))
     clonelayer.train(x)
     clonelayer.stop_training()
     assert clonelayer.use_copies is True
예제 #4
0
 def test_use_copies_msg(self):
     """Test the correct reaction to an outgoing use_copies message."""
     stop_result = ({"clonelayer" + MSG_ID_SEP + "use_copies": True}, 1)
     stop_sfa_node = SFABiNode(stop_result=stop_result,
                               input_dim=10, output_dim=3)
     clonelayer = CloneBiLayer(node=stop_sfa_node,
                               n_nodes=3,
                               use_copies=False,
                               node_id="clonelayer")
     x = n.random.random((100,30))
     clonelayer.train(x)
     clonelayer.stop_training()
     assert clonelayer.use_copies is True