-
Notifications
You must be signed in to change notification settings - Fork 25
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
請問要怎麼加入新的一層embedding後送入BERT model訓練 #10
Comments
感謝您的回覆,我有依照您的建議進行修改,但會出現 TypeError: embedding(): argument 'indices' (position 2) must be Tensor, not NoneType 這個錯誤的訊息。 以下是我的程式碼 當中有新增embedding叫做clinical_feature_embedding 回傳到embeddings 還懇請您協助解惑,感激不盡 |
抱歉原先不小心設定成private了 以下是程式碼 當中新增的embedding叫做clinical_feature_embedding 回傳到embedding 再麻煩您提點了 |
你直接修改了BertEmbeddings,當然這也是沒問題的 embedding_output = self.embeddings(
input_ids=input_ids,
position_ids=position_ids,
token_type_ids=token_type_ids,
inputs_embeds=inputs_embeds,
past_key_values_length=past_key_values_length,
clinical_feature_ids=clinical_feature_ids
) 刪除L973, L974 # clinical_feature_embeddings_output = self.embeddings.clinical_feature_embeddings(clinical_feature_ids)
# embedding_output = embedding_output + clinical_feature_embeddings_output |
你的
|
你可能會需要注意 self.clinical_feature_embeddings = nn.Embedding(config.vocab_size, config.hidden_size, padding_idx=config.pad_token_id) |
您好,感謝您釋出台北QA的程式碼,有個問題想請教您~
想請問除了word embedding、position embedding、segment embegginh等三者之外,如果有其他的feature做成的embedding,要如何使其能相疊並且送入BERT model去訓練呢?
感謝您 =D
The text was updated successfully, but these errors were encountered: