Total loss

Define the total loss, which is the weighted sum of the margin loss and the reconstructed loss:

alpha = 0.0005
total_loss = margin_loss + alpha * reconstruction_loss

Optimize the loss using the Adam optimizer:

optimizer = tf.train.AdamOptimizer(0.0001)
train_op = optimizer.minimize(total_loss)
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset