Class: Transformers::Bert::BertOnlyMLMHead

Inherits:
Torch::NN::Module
  • Object
show all
Defined in:
lib/transformers/models/bert/modeling_bert.rb

Instance Method Summary collapse

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