Class: SamplerConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/toy/train/sampler.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSamplerConfig

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_tokensObject

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_penaltyObject

Returns the value of attribute rep_penalty.



21
22
23
# File 'lib/toy/train/sampler.rb', line 21

def rep_penalty
  @rep_penalty
end

#seedObject

Returns the value of attribute seed.



21
22
23
# File 'lib/toy/train/sampler.rb', line 21

def seed
  @seed
end

#temperatureObject

Returns the value of attribute temperature.



21
22
23
# File 'lib/toy/train/sampler.rb', line 21

def temperature
  @temperature
end

#top_kObject

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_pObject

Returns the value of attribute top_p.



21
22
23
# File 'lib/toy/train/sampler.rb', line 21

def top_p
  @top_p
end