We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi Could you please guide me how to change the generator loss function in the code? I'm going to change this function:
Which part of the relevant code should be changed?
self.rewards = tf.placeholder(dtype=tf.float32, shape=[None, None]) self.rewards_loss = tf.reduce_sum( tf.reduce_sum( tf.one_hot(tf.to_int32(tf.reshape(self.x, [-1])), self.num_emb, 1.0, 0.0) * tf.clip_by_value( tf.reshape(self.g_predictions, [-1, self.num_emb]), 1e-20, 1.0) , 1) * tf.reshape(self.rewards, [-1]) # * tf.reshape(self.target_weights, [-1]) ) optimizer_gan = tf.train.RMSPropOptimizer(self.learning_rate) gradients_gan, v_gan = zip(*optimizer_gan.compute_gradients(self.rewards_loss)) gradients_gan, _gan = tf.clip_by_global_norm(gradients_gan, self.grad_clip) self.rewards_updates = optimizer_gan.apply_gradients(zip(gradients_gan, v_gan), global_step=self.global_step)
or elsewhere?
Thank you
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi
Could you please guide me how to change the generator loss function in the code?
I'm going to change this function:
Which part of the relevant code should be changed?
or elsewhere?
Thank you
The text was updated successfully, but these errors were encountered: