import tensorflow as tf

        self.image_real_A = self.images_real[:,:,:,:self.input_dim]
        self.image_real_B = self.images_real[:,:,:,self.input_dim:self.input_dim + self.output_dim]
        self.images_fake_B = self.build_generator(self.image_real_A,reuse=False,name='generator_AB')
        self.images_fake_A = self.build_generator(self.images_fake_B,reuse=False,name='generator_BA')
        self.images_fake_A_ = self.build_generator(self.image_real_B,reuse=True,name='generator_BA')
        self.images_fake_B_ = self.build_generator(self.images_fake_A_,reuse=True,name='generator_AB')
        
        self.D_B_fake = self.build_discriminator(self.images_fake_B ,reuse=False, name="discriminatorB")
        self.D_A_fake = self.build_discriminator(self.images_fake_A_,reuse=False, name="discriminatorA") 

        self.D_B_real = self.build_discriminator(self.image_real_B,reuse=True, name="discriminatorB")
        self.D_A_real = self.build_discriminator(self.image_real_A,reuse=True, name="discriminatorA")

         
        
        self.loss_GABA = self.lambda_l2*squared_loss(self.images_fake_A,self.image_real_A) + binary_cross_entropy_loss(labels=tf.ones_like(self.D_B_fake),logits=self.D_B_fake)
        self.loss_GBAB = self.lambda_l2*squared_loss(self.images_fake_B_,self.image_real_B) + binary_cross_entropy_loss(labels=tf.ones_like(self.D_A_fake),logits=self.D_A_fake)
        self.generator_loss = self.loss_GABA + self.loss_GBAB
              
                
        self.D_B_loss_real = binary_cross_entropy_loss(tf.ones_like(self.D_B_real),self.D_B_real)
        self.D_B_loss_fake = binary_cross_entropy_loss(tf.zeros_like(self.D_B_fake),self.D_B_fake)
        self.D_B_loss = (self.D_B_loss_real + self.D_B_loss_fake) / 2.0
        
        
        self.D_A_loss_real = binary_cross_entropy_loss(tf.ones_like(self.D_A_real),self.D_A_real)
        self.D_A_loss_fake = binary_cross_entropy_loss(tf.zeros_like(self.D_A_fake),self.D_A_fake)
        self.D_A_loss = (self.D_A_loss_real + self.D_A_loss_fake) / 2.0
        
        self.discriminator_loss = self.D_B_loss + self.D_A_loss
