Skip to main content

EventProcessorTraining

Trait EventProcessorTraining 

Source
pub trait EventProcessorTraining<TrainEvent, ValidEvent>: Send {
    // Required methods
    fn process_train(
        &mut self,
        event: TrainEvent,
    ) -> Result<(), EventProcessorError>;
    fn process_valid(
        &mut self,
        event: ValidEvent,
    ) -> Result<(), EventProcessorError>;
    fn renderer(self) -> Box<dyn MetricsRenderer>;

    // Provided method
    fn flush(&mut self) -> Result<(), EventProcessorError> { ... }
}
Expand description

Process events happening during training and validation.

Required Methods§

Source

fn process_train( &mut self, event: TrainEvent, ) -> Result<(), EventProcessorError>

Collect a training event.

§Errors

Returns a EventProcessorError listing every metric that could not process the event. The other metrics still processed it. Note that an asynchronous processor reports it on a later call instead (see AsyncProcessorTraining).

Source

fn process_valid( &mut self, event: ValidEvent, ) -> Result<(), EventProcessorError>

Collect a validation event.

§Errors

Same as process_train.

Source

fn renderer(self) -> Box<dyn MetricsRenderer>

Returns the renderer used for training.

Provided Methods§

Source

fn flush(&mut self) -> Result<(), EventProcessorError>

Wait until previously submitted events are processed (no-op for sync processors).

§Errors

Returns a EventProcessorError listing every metric failure among the events processed since the last error was reported.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<ET: Send, EV: Send> EventProcessorTraining<ET, EV> for AsyncProcessorTraining<ET, EV>

Source§

impl<TS: ItemLazy, ES: ItemLazy> EventProcessorTraining<RLEvent<TS, ES>, AgentEvaluationEvent<ES>> for RLEventProcessor<TS, ES>

Available on crate feature rl only.