y_dim=6,
          dataset_name='AmazonFashion6ImgPartitioned.npy',
          input_fname_pattern='*,jpg',
          crop='False',
          checkpoint_dir='../GAN/checkpoint',
          sample_dir='.')

dcgan.load('../GAN/checkpoint')


with tf.device('/gpu:0'):
    x=np.random.normal(0,0.5,size=[16,256])
    z=tf.Variable(x,name='input_code',dtype=tf.float32)
    y=tf.placeholder(dtype=tf.float32,shape=[16,6])
    gan_image=dcgan.get_gen(z, y)
    gan_rf=dcgan.get_dis(gan_image, y)
    
    image=tf.image.resize_nearest_neighbor(images=gan_image, size=[224,224], align_corners=None, name=None)
    
    with tf.variable_scope("DVBPR") as scope:
        scope.reuse_variables()
        result = CNN(image,1.0)

lamda=1.0
user=tf.placeholder(dtype=tf.int32,shape=[1])

with tf.variable_scope('opt'):
    obj=tf.reduce_mean(tf.matmul(result,tf.transpose(tf.gather(thetau,user))))-tf.reduce_mean(tf.square(gan_rf-1))*lamda
    optimizer = tf.train.AdamOptimizer(learning_rate=0.05).minimize(-obj,var_list=[z])
    idx=tf.reduce_sum(tf.matmul(result,tf.transpose(tf.gather(thetau,user))),1)