class CooCoo::Trainer::BatchStats

Attributes

batch[R]
batch_size[R]
total_loss[R]
total_time[R]
trainer[R]

Public Class Methods

new(trainer, batch, batch_size, total_time, total_loss) click to toggle source
# File lib/coo-coo/trainer/batch_stats.rb, line 10
def initialize(trainer, batch, batch_size, total_time, total_loss)
  @trainer = trainer
  @batch = batch
  @batch_size = batch_size
  @total_time = total_time
  @total_loss = total_loss
end

Public Instance Methods

average_loss() click to toggle source
# File lib/coo-coo/trainer/batch_stats.rb, line 22
def average_loss
  total_loss / batch_size.to_f
end
average_time() click to toggle source
# File lib/coo-coo/trainer/batch_stats.rb, line 18
def average_time
  total_time / batch_size.to_f
end