def __call__(self, x): h1 = F.max_pooling_2d(F.relu(self.conv1(x)), ksize=2, stride=2) h2 = F.max_pooling_2d(F.relu(self.conv2(h1)), ksize=2, stride=2) h3 = F.max_pooling_2d(F.relu(self.conv3(h2)), ksize=2, stride=2) h4 = F.tanh(self.l4(h3)) # -1〜+1に納める return distribution.ContinuousDeterministicDistribution( h4) #連続値(6次元のベクトル)を返す
def __call__(self, x): # Model if self.model_call is not None: h = self.model_call(self.model, x) else: h = self.model(x) # Action filter if self.action_filter is not None: h = self.action_filter(h) # Wrap by Distribution return distribution.ContinuousDeterministicDistribution(h)
def setUp(self): self.x = np.random.rand(self.batch_size, self.ndim).astype(np.float32) self.distrib = distribution.ContinuousDeterministicDistribution(self.x)