Class: SamplerConfig
- Inherits:
-
Object
- Object
- SamplerConfig
- Defined in:
- lib/toy/train/sampler.rb
Instance Attribute Summary collapse
-
#max_tokens ⇒ Object
Returns the value of attribute max_tokens.
-
#rep_penalty ⇒ Object
Returns the value of attribute rep_penalty.
-
#seed ⇒ Object
Returns the value of attribute seed.
-
#temperature ⇒ Object
Returns the value of attribute temperature.
-
#top_k ⇒ Object
Returns the value of attribute top_k.
-
#top_p ⇒ Object
Returns the value of attribute top_p.
Instance Method Summary collapse
-
#initialize ⇒ SamplerConfig
constructor
A new instance of SamplerConfig.
Constructor Details
#initialize ⇒ SamplerConfig
Returns a new instance of SamplerConfig.
23 24 25 26 27 28 29 30 |
# File 'lib/toy/train/sampler.rb', line 23 def initialize @temperature = 0.0 # 0 = greedy argmax @top_k = 0 # 0 = disabled @top_p = 1.0 # 1.0 = disabled @rep_penalty = 1.0 # 1.0 = disabled @seed = 42 @max_tokens = 64 end |
Instance Attribute Details
#max_tokens ⇒ Object
Returns the value of attribute max_tokens.
21 22 23 |
# File 'lib/toy/train/sampler.rb', line 21 def max_tokens @max_tokens end |
#rep_penalty ⇒ Object
Returns the value of attribute rep_penalty.
21 22 23 |
# File 'lib/toy/train/sampler.rb', line 21 def rep_penalty @rep_penalty end |
#seed ⇒ Object
Returns the value of attribute seed.
21 22 23 |
# File 'lib/toy/train/sampler.rb', line 21 def seed @seed end |
#temperature ⇒ Object
Returns the value of attribute temperature.
21 22 23 |
# File 'lib/toy/train/sampler.rb', line 21 def temperature @temperature end |
#top_k ⇒ Object
Returns the value of attribute top_k.
21 22 23 |
# File 'lib/toy/train/sampler.rb', line 21 def top_k @top_k end |
#top_p ⇒ Object
Returns the value of attribute top_p.
21 22 23 |
# File 'lib/toy/train/sampler.rb', line 21 def top_p @top_p end |