def connect_zx(self, z): # first concatenate x_scrambled = keras.layers.Concatenate()(z) # unscramble x self.output_x = IndexLayer(self.indices_merge)( x_scrambled) # , name='output_x' return self.output_x
def connect_xz(self, x): # first concatenate z_scrambled = keras.layers.Concatenate()(x) # unscramble x self.output_z = IndexLayer(self.indices_merge)( z_scrambled) # , name='output_z' return self.output_z
def connect_zx(self, z): # if we have reduced the dimension, we ignore the last dimensions from the z-direction. if self.keepdims < self.dim: z = IndexLayer(np.arange(0, self.keepdims))(z) self.output_x = keras.layers.Lambda(lambda z: tf.matmul(z, self.Tblacken) + self.X0mean)(z) # Jacobian self.log_det_zx = keras.layers.Lambda(lambda z: -self.jacobian_xz * keras.backend.ones((tf.shape(z)[0], 1)))(z) return self.output_x
def connect_zx(self, z): self.input_z = z z = IndexLayer(np.arange(0, self.dim-6))(z) self.output_x = keras.layers.Lambda(lambda z: self.z2x(z)[0])(z) self.angle_loss = keras.layers.Lambda(lambda z: self.z2x(z)[1])(z) # self.log_det_zx = keras.layers.Lambda(lambda z: log_det_jacobian(self.z2x(z), z))(z) self.log_det_zx = keras.layers.Lambda(lambda z: self.z2x_jacobian(z))(z) return self.output_x
def connect_xz(self, x): # split X into different coordinate channels self.output_z = [ IndexLayer(isplit)(x) for isplit in self.indices_split ] return self.output_z
def connect_zx(self, z): self.output_x = IndexLayer(self.reverse)(z) return self.output_x
def connect_xz(self, x): self.output_z = IndexLayer(self.order)(x) return self.output_z