Class: Transformers::Distilbert::DistilBertConfig
- Inherits:
-
PretrainedConfig
- Object
- PretrainedConfig
- Transformers::Distilbert::DistilBertConfig
- Defined in:
- lib/transformers/models/distilbert/configuration_distilbert.rb
Instance Attribute Summary collapse
-
#activation ⇒ Object
readonly
Returns the value of attribute activation.
-
#attention_dropout ⇒ Object
readonly
Returns the value of attribute attention_dropout.
-
#dim ⇒ Object
readonly
Returns the value of attribute dim.
-
#dropout ⇒ Object
readonly
Returns the value of attribute dropout.
-
#hidden_dim ⇒ Object
readonly
Returns the value of attribute hidden_dim.
-
#initializer_range ⇒ Object
readonly
Returns the value of attribute initializer_range.
-
#max_position_embeddings ⇒ Object
readonly
Returns the value of attribute max_position_embeddings.
-
#n_heads ⇒ Object
readonly
Returns the value of attribute n_heads.
-
#n_layers ⇒ Object
readonly
Returns the value of attribute n_layers.
-
#pad_token_id ⇒ Object
readonly
Returns the value of attribute pad_token_id.
-
#qa_dropout ⇒ Object
readonly
Returns the value of attribute qa_dropout.
-
#seq_classif_dropout ⇒ Object
readonly
Returns the value of attribute seq_classif_dropout.
-
#sinusoidal_pos_embds ⇒ Object
readonly
Returns the value of attribute sinusoidal_pos_embds.
-
#vocab_size ⇒ Object
readonly
Returns the value of attribute vocab_size.
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
-
#initialize(vocab_size: 30522, max_position_embeddings: 512, sinusoidal_pos_embds: false, n_layers: 6, n_heads: 12, dim: 768, hidden_dim: 4 * 768, dropout: 0.1, attention_dropout: 0.1, activation: "gelu", initializer_range: 0.02, qa_dropout: 0.1, seq_classif_dropout: 0.2, pad_token_id: 0, **kwargs) ⇒ DistilBertConfig
constructor
A new instance of DistilBertConfig.
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
Constructor Details
#initialize(vocab_size: 30522, max_position_embeddings: 512, sinusoidal_pos_embds: false, n_layers: 6, n_heads: 12, dim: 768, hidden_dim: 4 * 768, dropout: 0.1, attention_dropout: 0.1, activation: "gelu", initializer_range: 0.02, qa_dropout: 0.1, seq_classif_dropout: 0.2, pad_token_id: 0, **kwargs) ⇒ DistilBertConfig
Returns a new instance of DistilBertConfig.
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 |
# File 'lib/transformers/models/distilbert/configuration_distilbert.rb', line 29 def initialize( vocab_size: 30522, max_position_embeddings: 512, sinusoidal_pos_embds: false, n_layers: 6, n_heads: 12, dim: 768, hidden_dim: 4 * 768, dropout: 0.1, attention_dropout: 0.1, activation: "gelu", initializer_range: 0.02, qa_dropout: 0.1, seq_classif_dropout: 0.2, pad_token_id: 0, **kwargs ) @vocab_size = vocab_size @max_position_embeddings = @sinusoidal_pos_embds = sinusoidal_pos_embds @n_layers = n_layers @n_heads = n_heads @dim = dim @hidden_dim = hidden_dim @dropout = dropout @attention_dropout = attention_dropout @activation = activation @initializer_range = initializer_range @qa_dropout = qa_dropout @seq_classif_dropout = seq_classif_dropout super(**kwargs, pad_token_id: pad_token_id) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Transformers::PretrainedConfig
Instance Attribute Details
#activation ⇒ Object (readonly)
Returns the value of attribute activation.
25 26 27 |
# File 'lib/transformers/models/distilbert/configuration_distilbert.rb', line 25 def activation @activation end |
#attention_dropout ⇒ Object (readonly)
Returns the value of attribute attention_dropout.
25 26 27 |
# File 'lib/transformers/models/distilbert/configuration_distilbert.rb', line 25 def attention_dropout @attention_dropout end |
#dim ⇒ Object (readonly)
Returns the value of attribute dim.
25 26 27 |
# File 'lib/transformers/models/distilbert/configuration_distilbert.rb', line 25 def dim @dim end |
#dropout ⇒ Object (readonly)
Returns the value of attribute dropout.
25 26 27 |
# File 'lib/transformers/models/distilbert/configuration_distilbert.rb', line 25 def dropout @dropout end |
#hidden_dim ⇒ Object (readonly)
Returns the value of attribute hidden_dim.
25 26 27 |
# File 'lib/transformers/models/distilbert/configuration_distilbert.rb', line 25 def hidden_dim @hidden_dim end |
#initializer_range ⇒ Object (readonly)
Returns the value of attribute initializer_range.
25 26 27 |
# File 'lib/transformers/models/distilbert/configuration_distilbert.rb', line 25 def initializer_range @initializer_range end |
#max_position_embeddings ⇒ Object (readonly)
Returns the value of attribute max_position_embeddings.
25 26 27 |
# File 'lib/transformers/models/distilbert/configuration_distilbert.rb', line 25 def @max_position_embeddings end |
#n_heads ⇒ Object (readonly)
Returns the value of attribute n_heads.
25 26 27 |
# File 'lib/transformers/models/distilbert/configuration_distilbert.rb', line 25 def n_heads @n_heads end |
#n_layers ⇒ Object (readonly)
Returns the value of attribute n_layers.
25 26 27 |
# File 'lib/transformers/models/distilbert/configuration_distilbert.rb', line 25 def n_layers @n_layers end |
#pad_token_id ⇒ Object (readonly)
Returns the value of attribute pad_token_id.
25 26 27 |
# File 'lib/transformers/models/distilbert/configuration_distilbert.rb', line 25 def pad_token_id @pad_token_id end |
#qa_dropout ⇒ Object (readonly)
Returns the value of attribute qa_dropout.
25 26 27 |
# File 'lib/transformers/models/distilbert/configuration_distilbert.rb', line 25 def qa_dropout @qa_dropout end |
#seq_classif_dropout ⇒ Object (readonly)
Returns the value of attribute seq_classif_dropout.
25 26 27 |
# File 'lib/transformers/models/distilbert/configuration_distilbert.rb', line 25 def seq_classif_dropout @seq_classif_dropout end |
#sinusoidal_pos_embds ⇒ Object (readonly)
Returns the value of attribute sinusoidal_pos_embds.
25 26 27 |
# File 'lib/transformers/models/distilbert/configuration_distilbert.rb', line 25 def sinusoidal_pos_embds @sinusoidal_pos_embds end |
#vocab_size ⇒ Object (readonly)
Returns the value of attribute vocab_size.
25 26 27 |
# File 'lib/transformers/models/distilbert/configuration_distilbert.rb', line 25 def vocab_size @vocab_size end |