SmartEngine  1.6.0
Public Member Functions | List of all members
SmartEngine::IAgent Class Referenceabstract

Agents are used to track the performance of one instance of a network. More...

#include <Agent.h>

Inheritance diagram for SmartEngine::IAgent:
SmartEngine::IObject SmartEngine::ISerializable SmartEngine::IObject

Public Member Functions

virtual void StartNewExperience ()=0
 Starts a new experience. It is expected that RecordObservation(), RecordAction(), and GiveReward() will all be called at least once before the next experience is started. More...
 
virtual void RecordObservation (const char *inputName, const float *buffer, int64 bufferCount)=0
 Records the input data to the network we are watching. More...
 
virtual void RecordAction (const char *actionName, const float *buffer, int64 bufferCount)=0
 Records the output of the network we applied to the environment (the game or character) More...
 
virtual void GiveReward (float reward)=0
 The trainers will try to maximize rewards. The higher the value, the better the rewards. Rewards can also be negative. More...
 
virtual void EndEpisode ()=0
 Called at the logical conclusion of a training session. Usually some event like the player died or the game ended. More...
 
- Public Member Functions inherited from SmartEngine::IObject
virtual ObjectId GetId () const =0
 Returns the ID of this object. More...
 
virtual void AddRef () const =0
 Increments the internal reference count on this object. It is not common to use this method directly. More...
 
virtual void Release () const =0
 Decrements the internal reference count on this object. It is not common to use this method directly. More...
 
virtual int GetRefCount () const =0
 Returns the number of references to this object. More...
 
virtual void * QueryInterface (ObjectClassId id)=0
 Queries the object for an interface and returns a pointer to that interface if found. More...
 
void operator= (IObject const &x)=delete
 
- Public Member Functions inherited from SmartEngine::ISerializable
virtual SerializationResult Serialize (IMemoryBuffer *buffer)=0
 Write the contents of this object to a buffer. More...
 
virtual SerializationResult Deserialize (IMemoryBuffer *buffer)=0
 Fill this object with contents from a buffer. More...
 

Additional Inherited Members

- Public Attributes inherited from SmartEngine::IObject
 private
 
 __pad0__: IObject() {} IObject(IObject const&) = delete
 

Detailed Description

Agents are used to track the performance of one instance of a network.

For each step, you start a new experience. Then record the observation (the network's input data), the action (output of the network), and the rewards it received during that time.

When you reach a logical conclusion of your training (the character dies or the game ends, for example), end the episode.

Member Function Documentation

◆ EndEpisode()

virtual void SmartEngine::IAgent::EndEpisode ( )
pure virtual

Called at the logical conclusion of a training session. Usually some event like the player died or the game ended.

◆ GiveReward()

virtual void SmartEngine::IAgent::GiveReward ( float  reward)
pure virtual

The trainers will try to maximize rewards. The higher the value, the better the rewards. Rewards can also be negative.

Parameters
reward

◆ RecordAction()

virtual void SmartEngine::IAgent::RecordAction ( const char *  actionName,
const float *  buffer,
int64  bufferCount 
)
pure virtual

Records the output of the network we applied to the environment (the game or character)

Parameters
actionNameThe name of the output graph node in the graph definition
actionDataIn the case of discrete actions, the index of the chosen neuron. For continuous actions, the raw output.

◆ RecordObservation()

virtual void SmartEngine::IAgent::RecordObservation ( const char *  inputName,
const float *  buffer,
int64  bufferCount 
)
pure virtual

Records the input data to the network we are watching.

Parameters
inputNameThe name of the BufferInput in the graph definition
obsDataThe buffer's input

◆ StartNewExperience()

virtual void SmartEngine::IAgent::StartNewExperience ( )
pure virtual

Starts a new experience. It is expected that RecordObservation(), RecordAction(), and GiveReward() will all be called at least once before the next experience is started.