Esempio n. 1
0
 def train(self, x=None, z=None, y=None):
     if x is None:
         return self.sess.run([self.G_optim, self.G_loss],
                              feed_dict={self.Z: z})[1]
     else:
         x = processing.img_preprocessing(x)
         return self.sess.run([self.D_optim, self.D_loss],
                              feed_dict={
                                  self.X: x,
                                  self.Z: z
                              })[1]
Esempio n. 2
0
 def train(self, y= None, x= None, z=None):
     if x is None:
         return self.sess.run([self.G_optim, self.G_loss], feed_dict = {
             self.Z: z,
             self.y: y,
             self.X: np.zeros(shape=[y.shape[0], self.input_shape[0]])
         })[1]
     else:
         x = processing.img_preprocessing(x)
         return self.sess.run([self.D_optim, self.D_loss], feed_dict = {
             self.X: x,
             self.Z: z,
             self.y: y,
         })[1]
Esempio n. 3
0
 def train(self, x= None, z=None, y=None):
     if x is None:
         disc, cont = self.sess.run([self.Q_disc_loss, self.Q_cont_loss], feed_dict = {
             self.Z: z[:, :self.noise_dim],
             self.c_dis: y,
             self.c_cont: z[:,self.noise_dim:]
         })
         #print('Q_loss 1. discrete:{} 2. continuous: {}'.format(disc,cont))
         return self.sess.run([self.G_optim, self.G_loss], feed_dict = {
             self.Z: z[:,:self.noise_dim],
             self.c_dis: y,
             self.c_cont: z[:,self.noise_dim:]
         })[1]
     else:
         x = processing.img_preprocessing(x)
         return self.sess.run([self.D_optim, self.D_loss], feed_dict = {
             self.X: x,
             self.Z: z[:, :self.noise_dim],
             self.c_dis: y,
             self.c_cont: z[:,self.noise_dim:]
         })[1]