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

公式9的意思? #13

Open
meshiguge opened this issue Nov 8, 2018 · 1 comment
Open

公式9的意思? #13

meshiguge opened this issue Nov 8, 2018 · 1 comment

Comments

@meshiguge
Copy link

你好,embedding的损失函数(9),只有K个训练样本的意思吗? 如何嵌套进training batch呢?

@ChunyuanLI
Copy link
Collaborator

Q1 about loss function (9) of label embeddings, what is the meaning of y_k, is it the label of embeddings or sequence class?
A1: y_k is the one-hot vector to represent the target (sequence class). Also in (9), c_k is the corresponding label embedding that we are going to learn.

Q2: If there are K=3 classes in the dataset, does it mean that there are 3 training sample for label ?
A2: If there are K=3 classes in the dataset, it means there are 3 label embeddings to learn (i.e., “3 training samples for labels”), one for each label.

Q3: How to process the label loss(9) in each batch of training case ?

A3: Note that label embeddings are associated with their corresponding label embeddings, i.e. each c_k is associated with its own y_k.

Eq (9) is a regularizer of the main loss (7). Therefore, for each text-label pair (x_n, y_nk), where n is the index of data sample, k is the ground-truth label (i.e. the k-th label), c_k is trained to satisfy two objectives: (A) stay in the center of its own class manifold, as imposed in (9); and (B) Attend the text sequence representation z_n in (7).

Sorry for the abuse of notations. A more correct but ugly formulation of (9) goes like this: 1/K sim_{k=1}^{K} sum_{n \in {n | y_n = k } } CE( y_nk, f_2(c_nk) )

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

2 participants