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

模型训练时目标域也需要标签训练数据吗? #3

Open
27182812 opened this issue Dec 26, 2020 · 2 comments
Open

模型训练时目标域也需要标签训练数据吗? #3

27182812 opened this issue Dec 26, 2020 · 2 comments

Comments

@27182812
Copy link

您好,通过阅读代码,模型训练时好像也用上了目标域的标记好的训练数据。
所以,如果我想要用在一个全新的领域还是需要标注的吗?

@hsqmlzno1
Copy link
Owner

您好,通过阅读代码,模型训练时好像也用上了目标域的标记好的训练数据。
所以,如果我想要用在一个全新的领域还是需要标注的吗?

只用到了目标领域的无标签数据,所以不需要标注

@27182812
Copy link
Author

for i in range(int(batch_num)):

        xs, win_xs, length_s, ys_ote, ys_ts, ys_opn, ys_stm, _, _ = S_batches.__next__()
        xt, win_xt, length_t, yt_ote, yt_ts, yt_opn, yt_stm, _, _ = T_batches.__next__()
        x = np.vstack([xs, xt])
        win_x  = np.vstack([win_xs, win_xt])
        length = np.hstack([length_s, length_t])
        y_ote  = np.vstack([ys_ote, yt_ote])
        y_ts   = np.vstack([ys_ts, yt_ts])
        y_opn   = np.vstack([ys_opn, yt_opn])
        y_stm  = np.vstack([ys_stm, yt_stm])

        feed_dict = get_train_feed_dict(model, x, win_x, length, y_ote, y_ts, y_opn, y_stm, cur_lr, params.dropout_rate, train_flag=True)

        _, loss, asp_loss, ts_loss, opn_loss = sess.run([model.train_op, model.loss, model.asp_loss, model.ts_loss, model.opn_loss], feed_dict=feed_dict)
        _, ote_transfer_loss = sess.run([model.ote_transfer_op, model.ote_transfer_loss], feed_dict=feed_dict)
        losses.add([loss, asp_loss, ts_loss, opn_loss, ote_transfer_loss])

那请问这里的作用是什么啊?用到了T_batch,要是我目标域没有标注数据,这边不会报错吗

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