Class: Trainers::TrainerState

Inherits:
Object
  • Object
show all
Defined in:
lib/trainers/callbacks.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTrainerState

Returns a new instance of TrainerState.



9
10
11
12
13
14
15
16
17
18
# File 'lib/trainers/callbacks.rb', line 9

def initialize
  @epoch                 = 0.0
  @global_step           = 0
  @max_steps             = 0
  @num_train_epochs      = 0
  @total_flos            = 0
  @best_metric           = nil
  @best_model_checkpoint = nil
  @log_history           = []
end

Instance Attribute Details

#best_metricObject

Returns the value of attribute best_metric.



5
6
7
# File 'lib/trainers/callbacks.rb', line 5

def best_metric
  @best_metric
end

#best_model_checkpointObject

Returns the value of attribute best_model_checkpoint.



5
6
7
# File 'lib/trainers/callbacks.rb', line 5

def best_model_checkpoint
  @best_model_checkpoint
end

#epochObject

Returns the value of attribute epoch.



5
6
7
# File 'lib/trainers/callbacks.rb', line 5

def epoch
  @epoch
end

#global_stepObject

Returns the value of attribute global_step.



5
6
7
# File 'lib/trainers/callbacks.rb', line 5

def global_step
  @global_step
end

#log_historyObject

Returns the value of attribute log_history.



5
6
7
# File 'lib/trainers/callbacks.rb', line 5

def log_history
  @log_history
end

#max_stepsObject

Returns the value of attribute max_steps.



5
6
7
# File 'lib/trainers/callbacks.rb', line 5

def max_steps
  @max_steps
end

#num_train_epochsObject

Returns the value of attribute num_train_epochs.



5
6
7
# File 'lib/trainers/callbacks.rb', line 5

def num_train_epochs
  @num_train_epochs
end

#total_flosObject

Returns the value of attribute total_flos.



5
6
7
# File 'lib/trainers/callbacks.rb', line 5

def total_flos
  @total_flos
end