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 __init__(self, nBatch, seed=0, nSample=2**11, nSampleTest=2**9): WaeEnvironment.__init__(self, nBatch) self.nX = 3 self.nZ = 1 self.randomState = np.random.RandomState(seed=seed) self.nSample = nSample self.nSampleTest = nSampleTest
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
def __init__(self, nBatch, d_out = 2, d_in = 1, seed = 0, nSample = 2**10): WaeEnvironment.__init__(self, nBatch) self.nX = 2 self.nZ = 1 self.d_out = d_out self.d_in = d_in self.randomState = np.random.RandomState(seed=seed) self.nSample = nSample
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