trainer

Module: environments.live.trainer

The module that trains pyspace flows.

Inheritance diagram for pySPACE.environments.live.trainer:

Inheritance diagram of pySPACE.environments.live.trainer

LiveTrainer

class pySPACE.environments.live.trainer.LiveTrainer(flow_storage='flow_storage', prewindowed_data_directory='prewindowed_data_storage')[source]

Bases: object

The class is responsible to perform all tasks in pyspace live that are related to the training process of pyspace The trained flows are stored in the flow_storage directory.

Class Components Summary

classification_thread(key) Thread that processes external training commands
find_files_older_than(then, dir)
is_training_active() Returns whether training is finished or still running
pause_training() Pause the training phase
prepare_training(training_files, potentials, ...) Prepares pyspace live for training.
process_external_command(command) Process external stop command
set_controller(controller) Set reference to the calling controller
set_eeg_stream_manager(stream_manager) Set the stream manager that provides the training data
start_training(operation[, profiling]) Trains flows on the streamed data
stop_training() Force the end of the training
stream_data(key) A function that forwards the data to the worker threads
training_fct(key) Function that performs the real training
triggered_queue_filler_training(data, label, key)
__init__(flow_storage='flow_storage', prewindowed_data_directory='prewindowed_data_storage')[source]
set_controller(controller)[source]

Set reference to the calling controller

set_eeg_stream_manager(stream_manager)[source]

Set the stream manager that provides the training data

prepare_training(training_files, potentials, operation, nullmarker_stride_ms=None)[source]

Prepares pyspace live for training.

Prepares everything for training of pyspace live, i.e. creates flows based on the dataflow specs and configures them.

find_files_older_than(then, dir)[source]
training_fct(key)[source]

Function that performs the real training

triggered_queue_filler_training(data, label, key)[source]
classification_thread(key)[source]

Thread that processes external training commands

stream_data(key)[source]

A function that forwards the data to the worker threads

start_training(operation, profiling=False)[source]

Trains flows on the streamed data

is_training_active()[source]

Returns whether training is finished or still running

process_external_command(command)[source]

Process external stop command

pause_training()[source]

Pause the training phase

stop_training()[source]

Force the end of the training

__weakref__

list of weak references to the object (if defined)