Пример #1
0
    def setUp(self):
        unittest.TestCase.setUp(self)

        WaeAgent.checkPointPath = "./testCheckPoint"

        environment = WaeEnvironment(nBatch=2**5)
        environment.loadData()

        nX = environment.nX
        nZ = environment.nZ
        nH = 2**5
        nXi = 2
        nLayer = int(np.random.choice((1, 2)))

        agent = WaeAgent(nX,
                         nZ,
                         nH,
                         nXi,
                         nLayer,
                         cluster_interval=3.0,
                         activation="relu")

        trainer = WaeTrainer(agent, environment, reg_param=0.1)

        self.environment = environment
        self.agent = agent
        self.trainer = trainer
    def test001(self):

        nBatch = 2**5

        environment = WaeEnvironment(nBatch)
        environment.loadData()
        for batchDataEnvironment in environment.generateBatchDataIterator():
            assert isinstance(batchDataEnvironment, WaeBatchDataEnvironment)
            _X = batchDataEnvironment._X
            _Z = batchDataEnvironment._Z
Пример #3
0
 def setUp(self):
     unittest.TestCase.setUp(self)
     
     WaeAgent.checkPointPath = "./testCheckPoint"
     
     environment = WaeEnvironment(nBatch = 2**5)
     environment.loadData()
     
     nX = environment.nX
     nZ = environment.nZ
     nH = 2**5
     nXi = 2
     nLayer = 2
     
     agent = WaeAgent(nX, nZ, nH, nXi, nLayer, cluster_interval = 3.0, activation = "tanh")
     agentAnother = WaeAgent(nX, nZ, nH, nXi, nLayer, cluster_interval = 3.0, activation = "tanh")
             
     self.agent = agent
     self.agentAnother = agentAnother
     self.environment = environment