Class: Transformers::XlmRoberta::XLMRobertaConfig

Inherits:
PretrainedConfig show all
Defined in:
lib/transformers/models/xlm_roberta/configuration_xlm_roberta.rb

Instance Attribute Summary collapse

Attributes inherited from PretrainedConfig

#_commit_hash, #add_cross_attention, #architectures, #chunk_size_feed_forward, #id2label, #is_decoder, #is_encoder_decoder, #output_attentions, #output_hidden_states, #problem_type, #pruned_heads, #tie_encoder_decoder, #tie_word_embeddings, #tokenizer_class

Instance Method Summary collapse

Methods inherited from PretrainedConfig

#_attn_implementation, #_dict, from_dict, from_pretrained, get_config_dict, #getattr, #hasattr, #method_missing, #name_or_path, #name_or_path=, #num_labels, #num_labels=, #respond_to_missing?, #to_dict, #to_diff_dict, #to_json_string, #to_s, #use_return_dict

Methods included from ClassAttribute

#class_attribute

Constructor Details

#initialize(vocab_size: 30522, hidden_size: 768, num_hidden_layers: 12, num_attention_heads: 12, intermediate_size: 3072, hidden_act: "gelu", hidden_dropout_prob: 0.1, attention_probs_dropout_prob: 0.1, max_position_embeddings: 512, type_vocab_size: 2, initializer_range: 0.02, layer_norm_eps: 1e-12, pad_token_id: 1, bos_token_id: 0, eos_token_id: 2, position_embedding_type: "absolute", use_cache: true, classifier_dropout: nil, **kwargs) ⇒ XLMRobertaConfig

Returns a new instance of XLMRobertaConfig.



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/transformers/models/xlm_roberta/configuration_xlm_roberta.rb', line 27

def initialize(
  vocab_size: 30522,
  hidden_size: 768,
  num_hidden_layers: 12,
  num_attention_heads: 12,
  intermediate_size: 3072,
  hidden_act: "gelu",
  hidden_dropout_prob: 0.1,
  attention_probs_dropout_prob: 0.1,
  max_position_embeddings: 512,
  type_vocab_size: 2,
  initializer_range: 0.02,
  layer_norm_eps: 1e-12,
  pad_token_id: 1,
  bos_token_id: 0,
  eos_token_id: 2,
  position_embedding_type: "absolute",
  use_cache: true,
  classifier_dropout: nil,
  **kwargs
)
  super(pad_token_id: pad_token_id, bos_token_id: bos_token_id, eos_token_id: eos_token_id, **kwargs)

  @vocab_size = vocab_size
  @hidden_size = hidden_size
  @num_hidden_layers = num_hidden_layers
  @num_attention_heads = num_attention_heads
  @hidden_act = hidden_act
  @intermediate_size = intermediate_size
  @hidden_dropout_prob = hidden_dropout_prob
  @attention_probs_dropout_prob = attention_probs_dropout_prob
  @max_position_embeddings = max_position_embeddings
  @type_vocab_size = type_vocab_size
  @initializer_range = initializer_range
  @layer_norm_eps = layer_norm_eps
  @position_embedding_type = position_embedding_type
  @use_cache = use_cache
  @classifier_dropout = classifier_dropout
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Transformers::PretrainedConfig

Instance Attribute Details

#attention_probs_dropout_probObject (readonly)

Returns the value of attribute attention_probs_dropout_prob.



21
22
23
# File 'lib/transformers/models/xlm_roberta/configuration_xlm_roberta.rb', line 21

def attention_probs_dropout_prob
  @attention_probs_dropout_prob
end

#bos_token_idObject (readonly)

Returns the value of attribute bos_token_id.



21
22
23
# File 'lib/transformers/models/xlm_roberta/configuration_xlm_roberta.rb', line 21

def bos_token_id
  @bos_token_id
end

#classifier_dropoutObject (readonly)

Returns the value of attribute classifier_dropout.



21
22
23
# File 'lib/transformers/models/xlm_roberta/configuration_xlm_roberta.rb', line 21

def classifier_dropout
  @classifier_dropout
end

#eos_token_idObject (readonly)

Returns the value of attribute eos_token_id.



21
22
23
# File 'lib/transformers/models/xlm_roberta/configuration_xlm_roberta.rb', line 21

def eos_token_id
  @eos_token_id
end

#hidden_actObject (readonly)

Returns the value of attribute hidden_act.



21
22
23
# File 'lib/transformers/models/xlm_roberta/configuration_xlm_roberta.rb', line 21

def hidden_act
  @hidden_act
end

#hidden_dropout_probObject (readonly)

Returns the value of attribute hidden_dropout_prob.



21
22
23
# File 'lib/transformers/models/xlm_roberta/configuration_xlm_roberta.rb', line 21

def hidden_dropout_prob
  @hidden_dropout_prob
end

#hidden_sizeObject (readonly)

Returns the value of attribute hidden_size.



21
22
23
# File 'lib/transformers/models/xlm_roberta/configuration_xlm_roberta.rb', line 21

def hidden_size
  @hidden_size
end

#initializer_rangeObject (readonly)

Returns the value of attribute initializer_range.



21
22
23
# File 'lib/transformers/models/xlm_roberta/configuration_xlm_roberta.rb', line 21

def initializer_range
  @initializer_range
end

#intermediate_sizeObject (readonly)

Returns the value of attribute intermediate_size.



21
22
23
# File 'lib/transformers/models/xlm_roberta/configuration_xlm_roberta.rb', line 21

def intermediate_size
  @intermediate_size
end

#layer_norm_epsObject (readonly)

Returns the value of attribute layer_norm_eps.



21
22
23
# File 'lib/transformers/models/xlm_roberta/configuration_xlm_roberta.rb', line 21

def layer_norm_eps
  @layer_norm_eps
end

#max_position_embeddingsObject (readonly)

Returns the value of attribute max_position_embeddings.



21
22
23
# File 'lib/transformers/models/xlm_roberta/configuration_xlm_roberta.rb', line 21

def max_position_embeddings
  @max_position_embeddings
end

#num_attention_headsObject (readonly)

Returns the value of attribute num_attention_heads.



21
22
23
# File 'lib/transformers/models/xlm_roberta/configuration_xlm_roberta.rb', line 21

def num_attention_heads
  @num_attention_heads
end

#num_hidden_layersObject (readonly)

Returns the value of attribute num_hidden_layers.



21
22
23
# File 'lib/transformers/models/xlm_roberta/configuration_xlm_roberta.rb', line 21

def num_hidden_layers
  @num_hidden_layers
end

#pad_token_idObject (readonly)

Returns the value of attribute pad_token_id.



21
22
23
# File 'lib/transformers/models/xlm_roberta/configuration_xlm_roberta.rb', line 21

def pad_token_id
  @pad_token_id
end

#position_embedding_typeObject (readonly)

Returns the value of attribute position_embedding_type.



21
22
23
# File 'lib/transformers/models/xlm_roberta/configuration_xlm_roberta.rb', line 21

def position_embedding_type
  @position_embedding_type
end

#type_vocab_sizeObject (readonly)

Returns the value of attribute type_vocab_size.



21
22
23
# File 'lib/transformers/models/xlm_roberta/configuration_xlm_roberta.rb', line 21

def type_vocab_size
  @type_vocab_size
end

#use_cacheObject (readonly)

Returns the value of attribute use_cache.



21
22
23
# File 'lib/transformers/models/xlm_roberta/configuration_xlm_roberta.rb', line 21

def use_cache
  @use_cache
end

#vocab_sizeObject (readonly)

Returns the value of attribute vocab_size.



21
22
23
# File 'lib/transformers/models/xlm_roberta/configuration_xlm_roberta.rb', line 21

def vocab_size
  @vocab_size
end