ksuit.utils.training.counter

Classes

UpdateCounter

UpdateCounter is used to track the current update, epoch, and sample

Module Contents

class ksuit.utils.training.counter.UpdateCounter(start_iteration, end_iteration, updates_per_epoch, effective_batch_size)

UpdateCounter is used to track the current update, epoch, and sample number during training.

Initializes UpdateCounter.

Parameters:
updates_per_epoch
start_iteration
end_iteration
cur_iteration
effective_batch_size
property is_full_epoch: bool

Returns True if the current update is a full epoch.

Return type:

bool

property epoch_as_float: float

Returns the current epoch as a float value.

Return type:

float

property epoch: int | None

Returns the current epoch.

Return type:

int | None

property update: int | None

Returns the current update.

Return type:

int | None

property sample: int | None

Returns the current sample.

Return type:

int | None

property is_finished: bool

Returns True if the end checkpoint is reached.

Return type:

bool

next_epoch()

Increments the current epoch by 1.

Return type:

None

next_update()

Increments the current update by 1.

Return type:

None

add_samples(num_samples)

Adds samples to the current sample count.

Parameters:

num_samples (int)

Return type:

None