Class: Toy::GPT2Config
- Inherits:
-
Object
- Object
- Toy::GPT2Config
- Defined in:
- lib/toy/models/toy_gpt2.rb
Overview
Hyperparameter bag. Use a class (not Hash) so Spinel sees a concrete struct with Int / Float fields.
Instance Attribute Summary collapse
-
#ctx ⇒ Object
Returns the value of attribute ctx.
-
#d_ff ⇒ Object
Returns the value of attribute d_ff.
-
#d_model ⇒ Object
Returns the value of attribute d_model.
-
#n_heads ⇒ Object
Returns the value of attribute n_heads.
-
#n_layers ⇒ Object
Returns the value of attribute n_layers.
-
#vocab ⇒ Object
Returns the value of attribute vocab.
Instance Method Summary collapse
-
#initialize(vocab, d_model, n_heads, d_ff, n_layers, ctx) ⇒ GPT2Config
constructor
A new instance of GPT2Config.
Constructor Details
#initialize(vocab, d_model, n_heads, d_ff, n_layers, ctx) ⇒ GPT2Config
Returns a new instance of GPT2Config.
24 25 26 27 28 29 30 31 |
# File 'lib/toy/models/toy_gpt2.rb', line 24 def initialize(vocab, d_model, n_heads, d_ff, n_layers, ctx) @vocab = vocab @d_model = d_model @n_heads = n_heads @d_ff = d_ff @n_layers = n_layers @ctx = ctx end |
Instance Attribute Details
#ctx ⇒ Object
Returns the value of attribute ctx.
22 23 24 |
# File 'lib/toy/models/toy_gpt2.rb', line 22 def ctx @ctx end |
#d_ff ⇒ Object
Returns the value of attribute d_ff.
22 23 24 |
# File 'lib/toy/models/toy_gpt2.rb', line 22 def d_ff @d_ff end |
#d_model ⇒ Object
Returns the value of attribute d_model.
22 23 24 |
# File 'lib/toy/models/toy_gpt2.rb', line 22 def d_model @d_model end |
#n_heads ⇒ Object
Returns the value of attribute n_heads.
22 23 24 |
# File 'lib/toy/models/toy_gpt2.rb', line 22 def n_heads @n_heads end |
#n_layers ⇒ Object
Returns the value of attribute n_layers.
22 23 24 |
# File 'lib/toy/models/toy_gpt2.rb', line 22 def n_layers @n_layers end |
#vocab ⇒ Object
Returns the value of attribute vocab.
22 23 24 |
# File 'lib/toy/models/toy_gpt2.rb', line 22 def vocab @vocab end |