EngineTask

class EngineTask.ClassificationTaskThread(network, devices, data, batches)[source]
evaluate(batchess, results, result_format, num_frames)[source]
class EngineTask.EvalTaskThread(network, devices, data, batches, **kwargs)[source]
initialize()[source]
class EngineTask.HDFForwardTaskThread(network, devices, data, batches, cache, compression='none')[source]
evaluate(batchess, results, result_format, num_frames)[source]
Parameters:
  • batchess (list[list[Batch]]) – batches per device
  • results (list[list[numpy.ndarray]]) – results per device
  • result_format (list[str]|None) – describes what we have in a result list

:returns some score or None :rtype: dict[str] | None

finalize()[source]
initialize()[source]
exception EngineTask.ModelBrokenError(msg, batches)[source]

We got a nan/inf at the result somewhere. This means that something is broken.

class EngineTask.PriorEstimationTaskThread(network, devices, data, batches, priori_file, target, extract_type)[source]
evaluate(batchess, results, result_format, num_frames)[source]
finalize()[source]
class EngineTask.TaskThread(task, network, devices, data, batches, eval_batch_size=0, start_batch=0, share_batches=False, report_prefix=None, exclude=None, epoch=None)[source]
Parameters:report_prefix (str) – such as epoch or so. only for reporting
class DeviceBatchRun(parent, devices)[source]
allocate()[source]
device_collect_results()[source]
device_mem_usage_str(devices)[source]
Return type:str | None
device_run()[source]
finish()[source]

:returns whether everything is fine.

print_process()[source]
run()[source]
stop()[source]
TaskThread.allocate_devices(selected_devices=None)[source]

Sets the device data, i.e. the next batches, via self.batches. This calls Dataset.load_seqs() to get the data. This sets:

device.targets device.ctc_targets device.tags device.index
Return type:list[list[EngineBatch.Batch]]

:returns list of batches per device

TaskThread.assign_dev_data(device, batches)[source]
TaskThread.epoch_norm_factor_for_result(key)[source]
TaskThread.evaluate(batchess, results, result_format, num_frames)[source]
Parameters:
  • batchess (list[list[EngineBatch.Batch]]) – batches per device
  • results (list[list[numpy.ndarray]]) – results per device
  • result_format (list[str]|None) – describes what we have in a result list

:returns some score or None :rtype: dict[str] | None

TaskThread.finalize()[source]

Called at the end of an epoch.

TaskThread.get_device_prepare_args()[source]
TaskThread.initialize()[source]

Called at the beginning of an epoch.

TaskThread.maybe_wait_for_batches(device, batches)[source]
TaskThread.prepare_device_for_batch(device)[source]
TaskThread.reduce(num_frames)[source]
TaskThread.run()[source]
TaskThread.run_inner()[source]
class EngineTask.TrainTaskThread(network, devices, data, batches, learning_rate, updater, seq_train_parallel=None, **kwargs)[source]
class CopyManager(devices)[source]
class CopyThread(device, network, copy_to_device)[source]
run()[source]
TrainTaskThread.CopyManager.copy_from_device()[source]
TrainTaskThread.CopyManager.copy_to_device(network)[source]
TrainTaskThread.finalize()[source]
TrainTaskThread.get_device_prepare_args()[source]
TrainTaskThread.initialize()[source]
TrainTaskThread.maybe_wait_for_batches(device, batches)[source]
TrainTaskThread.prepare_device_for_batch(device)[source]
TrainTaskThread.reduce(num_frames)[source]
TrainTaskThread.save_ctc_priors(filename, epoch_str)[source]