Class: Transformers::Bert::BertOnlyMLMHead
- Inherits:
-
Torch::NN::Module
- Object
- Torch::NN::Module
- Transformers::Bert::BertOnlyMLMHead
- Defined in:
- lib/transformers/models/bert/modeling_bert.rb
Instance Method Summary collapse
- #forward(sequence_output) ⇒ Object
-
#initialize(config) ⇒ BertOnlyMLMHead
constructor
A new instance of BertOnlyMLMHead.
Constructor Details
#initialize(config) ⇒ BertOnlyMLMHead
Returns a new instance of BertOnlyMLMHead.
504 505 506 507 |
# File 'lib/transformers/models/bert/modeling_bert.rb', line 504 def initialize(config) super() @predictions = BertLMPredictionHead.new(config) end |
Instance Method Details
#forward(sequence_output) ⇒ Object
509 510 511 512 |
# File 'lib/transformers/models/bert/modeling_bert.rb', line 509 def forward(sequence_output) prediction_scores = @predictions.(sequence_output) prediction_scores end |