Skip to content
New issue

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

the loss function is inconsistent with that in the paper #16

Open
wannibar opened this issue Mar 16, 2021 · 0 comments
Open

the loss function is inconsistent with that in the paper #16

wannibar opened this issue Mar 16, 2021 · 0 comments

Comments

@wannibar
Copy link

hi, I love what you do and open source work.
and I have a question about the loss function.
I read your paper, the paper said loss function is MFE and MSFE.
but I found the code is:

   for i in range(logits.get_shape().as_list()[-1]): # [128, None, 7]
        class_fill_targets = tf.fill(tf.shape(targets), i) #[?,?]
        weights_i = tf.cast(tf.equal(targets, class_fill_targets), "float") #[?,?] 
        loss_is.append(tf.contrib.seq2seq.sequence_loss(logits, targets, weights_i, average_across_batch=False))

I googled this function. It compute cross-entropy loss. also weights_i parameter is my another question.
for example, when i=7 the weight is 7.
If I have something wrong, can you help me clarify it. thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant