Class: Trainers::TrainerState
- Inherits:
-
Object
- Object
- Trainers::TrainerState
- Defined in:
- lib/trainers/callbacks.rb
Instance Attribute Summary collapse
-
#best_metric ⇒ Object
Returns the value of attribute best_metric.
-
#best_model_checkpoint ⇒ Object
Returns the value of attribute best_model_checkpoint.
-
#epoch ⇒ Object
Returns the value of attribute epoch.
-
#global_step ⇒ Object
Returns the value of attribute global_step.
-
#log_history ⇒ Object
Returns the value of attribute log_history.
-
#max_steps ⇒ Object
Returns the value of attribute max_steps.
-
#num_train_epochs ⇒ Object
Returns the value of attribute num_train_epochs.
-
#total_flos ⇒ Object
Returns the value of attribute total_flos.
Instance Method Summary collapse
-
#initialize ⇒ TrainerState
constructor
A new instance of TrainerState.
Constructor Details
#initialize ⇒ TrainerState
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_metric ⇒ Object
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_checkpoint ⇒ Object
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 |
#epoch ⇒ Object
Returns the value of attribute epoch.
5 6 7 |
# File 'lib/trainers/callbacks.rb', line 5 def epoch @epoch end |
#global_step ⇒ Object
Returns the value of attribute global_step.
5 6 7 |
# File 'lib/trainers/callbacks.rb', line 5 def global_step @global_step end |
#log_history ⇒ Object
Returns the value of attribute log_history.
5 6 7 |
# File 'lib/trainers/callbacks.rb', line 5 def log_history @log_history end |
#max_steps ⇒ Object
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_epochs ⇒ Object
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_flos ⇒ Object
Returns the value of attribute total_flos.
5 6 7 |
# File 'lib/trainers/callbacks.rb', line 5 def total_flos @total_flos end |