unreal.LearningAgentsFlowMatchingTrainer

class unreal.LearningAgentsFlowMatchingTrainer(outer: Object | None = None, name: Name | str = 'None')

Bases: LearningAgentsManagerListener

The ULearningAgentsFlowMatchingTrainer enables imitation learning with flow matching. Inference actions are generated by integrating the learned velocity field with ODE approximates. see: ULearningAgentsFlowMatching for the Denoiser class that performs ODE integration during inference. see: ULearningAgentsRecorder to understand how to make new recordings.

C++ Source:

  • Plugin: LearningAgents

  • Module: LearningAgentsTraining

  • File: LearningAgentsFlowMatchingTrainer.h

Editor Properties: (see get_editor_property/set_editor_property)

  • has_training_failed (bool): [Read-Only] True if trainer encountered an unrecoverable error during training (e.g. the trainer process timed out). Otherwise, false. This exists mainly to keep the editor from locking up if something goes wrong during training.

  • interactor (LearningAgentsInteractor): [Read-Only] The interactor being trained.

  • is_setup (bool): [Read-Only] True if this object has been setup. Otherwise, false.

  • is_training (bool): [Read-Only] True if training is currently in-progress. Otherwise, false.

  • manager (LearningAgentsManager): [Read-Only] The manager this object is associated with.

  • model (LearningAgentsFlowMatching): [Read-Only] The flow matching model being trained.

  • visual_logger_objects (Map[Name, LearningAgentsVisualLoggerObject]): [Read-Only] The visual logger objects associated with this listener.

begin_training(recording, flow_matching_trainer_settings=[['None']], flow_matching_trainer_training_settings=[[], [], [True, True], LearningAgentsTrainingDevice.GPU], flow_matching_trainer_path_settings=[]) None

Begins the training process with the provided settings.

Parameters:
end_training() None

Stops the training process.

has_training_failed() bool

Returns true if the trainer has failed to communicate with the external training process. This can be used in combination with RunTraining to avoid filling the logs with errors.

Returns:

True if the training has failed. Otherwise, false.

Return type:

bool

is_training() bool

Returns true if the trainer is currently training; Otherwise, false.

Return type:

bool

iterate_training() None

Iterates the training process and gets the updated Denoiser network.

classmethod make_flow_matching_trainer(manager, interactor, flow_matching_model, communicator, class_=None, name="FlowMatchingTrainer") -> (LearningAgentsFlowMatchingTrainer, manager=LearningAgentsManager, interactor=LearningAgentsInteractor, flow_matching_model=LearningAgentsFlowMatching)

Constructs the flow matching trainer and runs the setup functions.

Parameters:
Returns:

manager (LearningAgentsManager): The agent manager we are using.

interactor (LearningAgentsInteractor): The agent interactor we are recording with.

flow_matching_model (LearningAgentsFlowMatching): The flow matching model we are using.

Return type:

tuple

run_training(recording, flow_matching_trainer_settings=[['None']], flow_matching_trainer_training_settings=[[], [], [True, True], LearningAgentsTrainingDevice.GPU], flow_matching_trainer_path_settings=[]) None

Convenience function that runs a basic training loop. If training has not been started, it will start it. On each following call to this function, it will call IterateTraining.

Parameters: