Skip to main content

EventProcessorTraining

Trait EventProcessorTraining 

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§

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).

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

Collect a validation event.

§Errors

Same as process_train.

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

Returns the renderer used for training.

Provided Methods§

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§

§

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

§

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