iCub-main
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
iCub::learningmachine::TrainEvent Class Reference

A TrainEvent is raised when the machine handles a training sample. More...

#include <TrainEvent.h>

+ Inheritance diagram for iCub::learningmachine::TrainEvent:

Public Member Functions

 TrainEvent (const yarp::sig::Vector &input, const yarp::sig::Vector &desired, const Prediction &predicted)
 Constructor.
 
virtual ~TrainEvent ()
 Destructor (empty).
 
virtual void visit (IEventListener &listener)
 Causes the Event to visit an EventListener.
 
std::string toString ()
 Returns a string representation of the Event.
 
yarp::sig::Vector & getInput ()
 Accessor for the vector of inputs.
 
yarp::sig::Vector & getDesired ()
 Accessor for the vector of desired outputs.
 
PredictiongetPredicted ()
 Accessor for the prediction.
 

Protected Attributes

yarp::sig::Vector input
 Vector of inputs.
 
yarp::sig::Vector desired
 Vector of desired outputs.
 
Prediction predicted
 Predicted outputs.
 

Detailed Description

A TrainEvent is raised when the machine handles a training sample.

It contains the input, and predicted and actual output vectors.

See also
iCub::learningmachine::IEvent
Author
Arjan Gijsberts

Definition at line 44 of file TrainEvent.h.

Constructor & Destructor Documentation

◆ TrainEvent()

iCub::learningmachine::TrainEvent::TrainEvent ( const yarp::sig::Vector &  input,
const yarp::sig::Vector &  desired,
const Prediction predicted 
)

Constructor.

Parameters
inputthe vector of inputs
desiredthe vector of desired outputs
predictedthe vector of predicted outputs

Definition at line 26 of file TrainEvent.cpp.

◆ ~TrainEvent()

virtual iCub::learningmachine::TrainEvent::~TrainEvent ( )
inlinevirtual

Destructor (empty).

Definition at line 74 of file TrainEvent.h.

Member Function Documentation

◆ getDesired()

yarp::sig::Vector & iCub::learningmachine::TrainEvent::getDesired ( )
inline

Accessor for the vector of desired outputs.

Returns
a reference to the registered vector of inputs

Definition at line 98 of file TrainEvent.h.

◆ getInput()

yarp::sig::Vector & iCub::learningmachine::TrainEvent::getInput ( )
inline

Accessor for the vector of inputs.

Returns
a reference to the registered vector of inputs

Definition at line 90 of file TrainEvent.h.

◆ getPredicted()

Prediction & iCub::learningmachine::TrainEvent::getPredicted ( )
inline

Accessor for the prediction.

Returns
a reference to the prediction

Definition at line 106 of file TrainEvent.h.

◆ toString()

std::string iCub::learningmachine::TrainEvent::toString ( )
virtual

Returns a string representation of the Event.

Returns
string the string representation

Implements iCub::learningmachine::IEvent.

Definition at line 36 of file TrainEvent.cpp.

◆ visit()

void iCub::learningmachine::TrainEvent::visit ( IEventListener listener)
virtual

Causes the Event to visit an EventListener.

This method is part of the double dispatch mechanism. Child classes need to override this function.

Parameters
listenerthe listener

Implements iCub::learningmachine::IEvent.

Definition at line 32 of file TrainEvent.cpp.

Member Data Documentation

◆ desired

yarp::sig::Vector iCub::learningmachine::TrainEvent::desired
protected

Vector of desired outputs.

Definition at line 54 of file TrainEvent.h.

◆ input

yarp::sig::Vector iCub::learningmachine::TrainEvent::input
protected

Vector of inputs.

Definition at line 49 of file TrainEvent.h.

◆ predicted

Prediction iCub::learningmachine::TrainEvent::predicted
protected

Predicted outputs.

Definition at line 59 of file TrainEvent.h.


The documentation for this class was generated from the following files: