SmartEngine  1.6.0
Classes | Typedefs | Enumerations | Functions | Variables
SmartEngine Namespace Reference

Classes

struct  A2CTrainerCInfo
 Data used to construct an IA2CTrainer instance More...
 
struct  ActivationNodeCInfo
 Data used to construct an activation node instance More...
 
struct  AgentDataStoreCInfo
 Data used to construct an IAgentDataStore instance More...
 
struct  BufferInputCInfo
 Data used to construct an IBufferInput instance More...
 
struct  ChoiceNodeCInfo
 Data used to construct a choice node instance More...
 
struct  ComponentInputBinding
 Dynamically binds a node to a component input. More...
 
struct  ComponentInputCInfo
 Data used to construct a component input instance More...
 
struct  ConcatNodeCInfo
 Data used to construct a concat node instance More...
 
struct  Conv2DInfo
 
struct  Conv2DLayerCInfo
 Conv2D layer constructor info More...
 
struct  CuriosityModuleCInfo
 Data used to construct an ICuriosityModule instance More...
 
struct  D4PGTrainerCInfo
 Data used to construct an ID4PGTrainer instance More...
 
struct  ExtractNodeCInfo
 Data used to construct an extract node instance More...
 
struct  GeneSwapInfo
 GeneticTrainer gene swap info More...
 
struct  GeneticAgentTrainerCInfo
 Data used to construct an IGeneticAgentTrainer instance More...
 
struct  GeneticTrainerCInfo
 Data used to construct an IA2CTrainer instance More...
 
struct  GeneticTrainerInitializationInfo
 Initializes the GeneticTrainer with a new population More...
 
struct  GeneticTrainingInfo
 GeneticTrainer parameter info More...
 
struct  GradientDescentTrainerCInfo
 Data used to construct an IGradientDescentTrainer instance More...
 
struct  GradientDescentTrainingInfo
 GradientDescentTrainer training info More...
 
struct  GraphCInfo
 Data used to construct an IGraph instance More...
 
struct  GraphComponentCInfo
 Data used to construct an IGraphComponent instance More...
 
struct  GraphControllerCInfo
 Data used to construct an IGraphController instance More...
 
struct  GraphInputCInfo
 Data used to construct an IGraphInput instance More...
 
struct  GraphManagerCInfo
 Data used to construct an IGraphManager instance More...
 
struct  GraphNodeCInfo
 Data used to construct an IGraphNode instance More...
 
class  IA2CTrainer
 The A2C Trainer is a reinforcement learning trainer that is composed of two parts: an actor sub graph and a critic sub-graph. More...
 
class  IAgent
 Agents are used to track the performance of one instance of a network. More...
 
class  IAgentDataStore
 The agent data store keeps experience data for the purpose of training. Some RL trainers don't store long term data in the store, while others keep a long history of data. More...
 
class  IAgentFactory
 RL trainers implement this to create agents. More...
 
class  IBufferInput
 Input node into the AI graph. Allows for specifying a tensor input. More...
 
class  IComponentInput
 Input node into a component. At the time of component construction, a node can be fed into this input. The incoming node must have the same dimension as this node. This node will then act as a passthrough for the incoming node. In this way, the component can be used at any point in the graph; not just the beginning. More...
 
class  IContext
 Every node in the AI graph must belong to the same context. More...
 
class  IConv2DLayer
 2D convolution layer. Input is interpreted as a 2D grid laid in row major order. Filters are applied to blocks of the input grid at a time, producing another 2D grid as output. This 2D grid can be fed into neuron layers where it will be treated as a 1D array. More...
 
class  ICuriosityModule
 A curiosity module is a way of rewarding an agent for behavior not yet seen. Rewards are given based on how expected the next set of observations are given the previous observations and the chosen actions. Unexpected results are given larger rewards than behavior the agent saw in the past, thus promoting the agent to be curious and explore the world. More...
 
class  ID4PGTrainer
 The D4PGTrainer is a reinforcement learning trainer that is composed of two parts: an actor sub graph and a critic sub-graph. Unlike A2C and PPO, the critic graph is created and managed internally by SmartEngine. You only need to supply the actor graph. More...
 
class  IGeneticAgentTrainer
 A genetic trainer that uses agents to automatically set the loss of each chromosome. Agents should be mapped to a chromosome after creation by calling MapAgentToChromosome() More...
 
class  IGeneticTrainer
 Trains a NeuronLayer / NeuralNetwork using a genetic algorithm. With each step, networks are sorted by loss. The top networks are left unchanged, while the bottom networks are replaced by new ones. The new networks are formed by mixing the weights of the top networks and randomly mutating weights / neurons. Lastly, the bottom percent of the networks can be replaced with completely random weights, adding some variability to the pool. More...
 
class  IGradientDescentTrainer
 Trains a set of networks using gradient descent. Training with GradientDescentTrainer requires a Loss structure and thus the output of the network must be known. If only a relative loss about the network is known, a GeneticTrainer needs to be used. More...
 
class  IGraph
 A graph is a collection of buffers and nodes that together form a neural network. The graph is created from a json definition file. After creation, the contents of the graph can be loaded from or saved to disk. More...
 
class  IGraphComponent
 A graph component allows graphs to embed other graphs. Nodes within components can be referenced using the following syntax: [Component Name]:[Component Graph Node Name] References can be chained together to dive to sub components. More...
 
class  IGraphController
 Represents a use of a graph. Owners of the controller feed data to the controller at regular intervals. When the graph model is executed, the controller will have data that can be acted upon More...
 
class  IGraphInput
 Base class for input nodes into the AI graph More...
 
class  IGraphInputOutput
 Views on top of models deal with this class to inject and extract data from the underlying model. More...
 
class  IGraphManager
 Connects graph controllers with graph models. Graph controllers define a single use of a graph. They pipe data to the model and later act on the output of the model. The model (usually a graph, but can be a dummy class) has the job of aggregating the input from one or more controllers and producing an output for each. More...
 
class  IGraphModel
 Takes input from a controller and produces an output. If using a graph as the model, this interface does not need to be implemented. However, you can provide an instance of this interface to create "dummy" models. More...
 
class  IGraphModelOutput
 Used to return output back to controllers. More...
 
class  IGraphNode
 A logical node in the AI graph. Some nodes, like NeuralNetwork, are composed of other nodes (neuron layers). More...
 
class  ILoss
 The loss of a NeuralNetwork is computed using the formula (Expected Ouput - Actual Output)^2 The mean of all these values across the output tensor is used when crunching down the loss to a single value. More...
 
class  ILossTrainer
 Base class for NeuralNetwork loss trainers More...
 
class  IMatrix
 Wrapper around either a const or a mutable matrix. More...
 
class  IMemoryBuffer
 Simple in memory buffer. Used for serialization, but can be used as a generic buffer too. More...
 
class  INeuronLayer
 A neuron layer is the trainable unit in the neural network graph. These can chained together to allow the network to learn and represent complex relationships. More...
 
class  IObject
 Base class for SmartEngine AI objects. It is not common to deal with this class directly. More...
 
class  IParameter
 A parameter is similar to a NeuronLayer in that it is trainable. However, it takes no input and is simply a layer of weights that can be used as input into other parts of the graph. More...
 
class  IPoolingLayer
 2D pooling layer. Typically used after a conv2d layer to reduce the output dimension. Fixed size of 2x2 blocks. More...
 
class  IPPOTrainer
 The PPO Trainer is a reinforcement learning trainer that is composed of two parts: an actor sub graph and a critic sub-graph. One of the differences between PPO and A2C is that PPO works off of large batches of data. Instead of waiting for a small batch before training, PPO will wait until there is a mega batch, called the trajectory. When we've received that much data, we train over it in normal batch sizes for a couple of times and then wait for the next trajectory. More...
 
class  IResource
 Base class for objects that can be loaded from and saved to disk. More...
 
class  IRLTrainer
 Base class for all reinforcement learning trainers. More...
 
class  ISerializable
 Base class for objects that can be loaded from and saved to an in memory buffer. More...
 
class  IStandardGraphModel
 Interface to the standard model that interacts with a graph. This can be used to extend the standard model with custom code by encapsulating this object More...
 
class  IUnpoolingLayer
 2D unpooling layer. Typically used before a conv2d transpose layer to expand the output dimension. Fixed size of 2x2 blocks. More...
 
struct  LayerInfo
 Layer information More...
 
struct  LossCInfo
 Data used to construct an ILoss instance More...
 
struct  LossTrainerCInfo
 Data used to construct an ILossTrainer instance. More...
 
struct  LossTrainingMethodInfo
 
struct  MaximumNodeCInfo
 Data used to construct a maximum node instance More...
 
struct  MinimumNodeCInfo
 Data used to construct a minimum node instance More...
 
struct  MultiplexerNodeCInfo
 Data used to construct a multiplexer node instance. More...
 
struct  MutationInfo
 GeneticTrainer mutation info More...
 
struct  NeuronLayerCInfo
 Data used to construct an INeuronLayer instance More...
 
struct  NormalNodeCInfo
 Data used to construct a normal node instance More...
 
class  ObjectPtr
 Smart pointer to an IObject. Automatic ref counting. More...
 
struct  ParameterCInfo
 Data used to construct an IParameter instance More...
 
struct  PoolingLayerCInfo
 Pool constructor info More...
 
struct  PPOTrainerCInfo
 Data used to construct an IPPOTrainer instance More...
 
struct  RegularizationLossInfo
 Regularization tries to keep the weight values from exploding during gradient descent by adding L1 and L2 loss of the weights. More...
 
struct  ResourceCInfo
 Data used to construct an IResource instance More...
 
struct  RLTrainerCInfo
 Data used to construct an IRLTrainer instance More...
 
struct  StandardGraphModelCInfo
 Data used to construct an IStandardGraphModel instance More...
 
struct  StopGradientNodeCInfo
 Data used to construct a stop gradient node instance More...
 
class  StrongNumber
 
struct  UnpoolingLayerCInfo
 Unpool constructor info More...
 
struct  UserAgentCInfo
 Data used to construct an overridable instance of IAgent More...
 
struct  UserGraphModelCInfo
 Data used to construct an overridable instance of IGraphModel More...
 

Typedefs

typedef void(SMARTENGINE_CALLBACK * Agent_StartNewExperience_Ptr) (void *userData)
 
typedef void(SMARTENGINE_CALLBACK * Agent_RecordObservation_Ptr) (void *userData, const char *inputName, const float *buffer, int64 bufferCount)
 
typedef void(SMARTENGINE_CALLBACK * Agent_RecordAction_Ptr) (void *userData, const char *actionName, const float *buffer, int64 bufferCount)
 
typedef void(SMARTENGINE_CALLBACK * Agent_GiveReward_Ptr) (void *userData, float reward)
 
typedef void(SMARTENGINE_CALLBACK * Agent_EndEpisode_Ptr) (void *userData)
 
typedef bool(* AssetStoreHandler) (const char *assetName, AssetType assetType, IMemoryBuffer *buffer)
 
typedef void(SMARTENGINE_CALLBACK * GraphModel_ClearData_Ptr) (void *userData)
 
typedef void(SMARTENGINE_CALLBACK * GraphModel_AddData_Ptr) (void *userData, const char *nodeName, ObjPtr data)
 
typedef void(SMARTENGINE_CALLBACK * GraphModel_RequestOutput_Ptr) (void *userData, int controllerId, const char *nodeName, int64 expectedRowCount)
 
typedef void(SMARTENGINE_CALLBACK * GraphModel_Execute_Ptr) (void *userData)
 
typedef void(SMARTENGINE_CALLBACK * GraphModel_RetrieveOutput_Ptr) (void *userData, int controllerId, ObjPtr modelOut)
 
typedef void(SMARTENGINE_CALLBACK * GraphModel_Reset_Ptr) (void *userData)
 
typedef unsigned int HashKey
 
using MatrixIndex = StrongNumber< struct MatrixIndexParam, std::ptrdiff_t >
 
typedef int64 ObjectId
 
typedef unsigned int ObjectClassId
 

Enumerations

enum  ActivationType : byte {
  ActivationType::None, ActivationType::Sigmoid, ActivationType::Tanh, ActivationType::Relu,
  ActivationType::Relu6, ActivationType::LeakyRelu, ActivationType::Softmax, ActivationType::Elu,
  ActivationType::Selu, ActivationType::Softplus, ActivationType::Normalize, ActivationType::NormalizeAllowSmallLengths,
  ActivationType::Count
}
 The activation function to apply to the output of the NeuronLayer More...
 
enum  AssetType : byte { AssetType::JsonString, AssetType::Binary, AssetType::Count }
 
enum  ChoiceType : byte { ChoiceType::Random, ChoiceType::Max, ChoiceType::Count }
 Defines the descision algorithm of the ChoiceNode More...
 
enum  DeviceType : byte { DeviceType::Default, DeviceType::Cpu, DeviceType::Gpu }
 The type of context to create. More...
 
enum  Conv2DType : byte {
  Conv2DType::Conv2D, Conv2DType::Conv2DWithBias, Conv2DType::Conv2DTranspose, Conv2DType::Conv2DTransposeWithBias,
  Conv2DType::Count
}
 
enum  GeneticAgentScoringMethod : byte { GeneticAgentScoringMethod::Sum, GeneticAgentScoringMethod::Average }
 Defines how the trainer deals with chromosome scores from multiple agents. More...
 
enum  MutationTarget : byte { MutationTarget::Auto, MutationTarget::Weight, MutationTarget::Neuron }
 
enum  GeneSwapTarget : byte { GeneSwapTarget::Weight, GeneSwapTarget::Neuron }
 
enum  GradientDescentTrainingAlgorithm : byte { GradientDescentTrainingAlgorithm::Adam, GradientDescentTrainingAlgorithm::AdaMax }
 
enum  LogLevel { LogLevel::Info, LogLevel::Warning, LogLevel::Error, LogLevel::Count }
 
enum  LossTrainingMethod : byte { LossTrainingMethod::WholeDataset, LossTrainingMethod::Stochastic }
 
enum  LayerType : byte { LayerType::LinearNoBias, LayerType::Linear, LayerType::LSTM, LayerType::Count }
 The type of layer to create More...
 
enum  PoolType : byte { PoolType::Max, PoolType::Average, PoolType::Count }
 
enum  SerializationResult : byte {
  SerializationResult::Success, SerializationResult::UnspecifiedError, SerializationResult::EndOfStream, SerializationResult::NotSupported,
  SerializationResult::Corrupted, SerializationResult::VersionTooLow, SerializationResult::InvalidResourceName, SerializationResult::InvalidObject,
  SerializationResult::InvalidBuffer, SerializationResult::InvalidInput, SerializationResult::InputCountMismatch, SerializationResult::InputDimensionMismatch,
  SerializationResult::TensorCountMismatch, SerializationResult::TensorSizeMismatch, SerializationResult::TensorDataSizeMismatch, SerializationResult::NodeCountMismatch,
  SerializationResult::NodeNotFound, SerializationResult::FileNotFound, SerializationResult::SignatureNotValid, SerializationResult::LicenseExpired,
  SerializationResult::InvalidGraphDefinition
}
 

Functions

SMARTENGINE_EXPORT ObjectPtr< IA2CTrainerCreateA2CTrainer (const A2CTrainerCInfo &cinfo)
 Creates an instance of IA2CTrainer More...
 
SMARTENGINE_EXPORT ObjectPtr< IAgentDataStoreCreateAgentDataStore (const AgentDataStoreCInfo &cinfo)
 Creates an instance of IAgentDataStore More...
 
SMARTENGINE_EXPORT ObjectPtr< IAgentCreateUserAgent (const UserAgentCInfo &cinfo)
 Creates an overridable instance of IAgent from a previously serialized agent. More...
 
SMARTENGINE_EXPORT void SetAssetStoreHandlers (AssetStoreHandler loadHandler, AssetStoreHandler saveHandler)
 Used to set the handler for custom loading and saving of assets. More...
 
SMARTENGINE_EXPORT ObjectPtr< IGraphNodeCreateConcatNode (const ConcatNodeCInfo &cinfo)
 Merges two or more node streams into one. Each input stream must have the same number of rows. The output dimension is the sum of the input dimensions. More...
 
SMARTENGINE_EXPORT ObjectPtr< IGraphNodeCreateExtractNode (const ExtractNodeCInfo &cinfo)
 Extracts a subset of columns from the input node. The start index + column count must not exceed the output dimension of the input node. More...
 
SMARTENGINE_EXPORT ObjectPtr< IGraphNodeCreateChoiceNode (const ChoiceNodeCInfo &cinfo)
 Returns a random choice (as an integer) from the input node's probability distribution on each call to RetrieveOutput(). More...
 
SMARTENGINE_EXPORT ObjectPtr< IGraphNodeCreateActivationNode (const ActivationNodeCInfo &cinfo)
 Applies an activation function to the input. More...
 
SMARTENGINE_EXPORT ObjectPtr< IGraphNodeCreateNormalNode (const NormalNodeCInfo &cinfo)
 Returns a random value from the normal distribution given by the input nodes. NOTE: Input takes in the variance and not the standard deviation. More...
 
SMARTENGINE_EXPORT ObjectPtr< IGraphNodeCreateMinimumNode (const MinimumNodeCInfo &cinfo)
 Takes the minimum of the inputs. More...
 
SMARTENGINE_EXPORT ObjectPtr< IGraphNodeCreateMaximumNode (const MaximumNodeCInfo &cinfo)
 Takes the maximum of the inputs. More...
 
SMARTENGINE_EXPORT ObjectPtr< IGraphNodeCreateStopGradientNode (const StopGradientNodeCInfo &cinfo)
 Stops the gradient from flowing backwards from this point. Only meaningful when training with gradient descent or reinforcement learning. More...
 
SMARTENGINE_EXPORT ObjectPtr< IGraphNodeCreateMultiplexerNode (const MultiplexerNodeCInfo &cinfo)
 Uses the value from the selector to decide which of the inputs to pass through. The selected input will be transmitted without adjustment. Each input should have the same dimension. The selector should have a dimension of 1 and a sigmoid activation. More...
 
SMARTENGINE_EXPORT ObjectPtr< IContextCreateContext (DeviceType device=DeviceType::Default)
 Creates a context using the specified device. More...
 
SMARTENGINE_EXPORT ObjectPtr< IConv2DLayerCreateConv2DLayer (const Conv2DLayerCInfo &cinfo)
 Creates an instance of IConv2DLayer More...
 
SMARTENGINE_EXPORT ObjectPtr< ICuriosityModuleCreateCuriosityModule (const CuriosityModuleCInfo &cinfo)
 Creates an instance of IA2CTrainer More...
 
SMARTENGINE_EXPORT ObjectPtr< ID4PGTrainerCreateD4PGTrainer (const D4PGTrainerCInfo &cinfo)
 Creates an instance of ID4PGTrainer More...
 
SMARTENGINE_EXPORT ObjectPtr< IGeneticAgentTrainerCreateGeneticAgentTrainer (const GeneticAgentTrainerCInfo &cinfo)
 Creates an instance of IGeneticAgentTrainer More...
 
SMARTENGINE_EXPORT ObjectPtr< IGeneticTrainerCreateGeneticTrainer (const GeneticTrainerCInfo &cinfo)
 Creates an instance of IGeneticTrainer More...
 
SMARTENGINE_EXPORT ObjectPtr< IGradientDescentTrainerCreateGradientDescentTrainer (const GradientDescentTrainerCInfo &cinfo)
 Creates an instance of IGradientDescentTrainer More...
 
SMARTENGINE_EXPORT ObjectPtr< IGraphCreateEmptyGraph (const GraphCInfo &cinfo)
 Creates a new, empty IGraph instance. More...
 
SMARTENGINE_EXPORT ObjectPtr< IGraphCreateGraphFromDefinition (const GraphCInfo &cinfo, const char *graphDefinition)
 Creates a new IGraph from a graph definition json string. More...
 
SMARTENGINE_EXPORT ObjectPtr< IGraphCreateGraphFromResource (const GraphCInfo &cinfo, const char *resourceName=nullptr)
 Creates and loads a new IGraph from a resource. More...
 
SMARTENGINE_EXPORT ObjectPtr< IGraphComponentCreateGraphComponent (const GraphComponentCInfo &cinfo)
 Creates an instance of IGraphComponent More...
 
SMARTENGINE_EXPORT ObjectPtr< IBufferInputCreateBufferInput (const BufferInputCInfo &cinfo)
 Creates an instance of IBufferInput More...
 
SMARTENGINE_EXPORT ObjectPtr< IComponentInputCreateComponentInput (const ComponentInputCInfo &cinfo)
 Creates an instance of IComponentInput More...
 
SMARTENGINE_EXPORT ObjectPtr< IGraphControllerCreateGraphController (const GraphControllerCInfo &cinfo)
 Creates an instance of IGraphController. More...
 
SMARTENGINE_EXPORT ObjectPtr< IStandardGraphModelCreateStandardGraphModel (const StandardGraphModelCInfo &cinfo)
 Creates an instance of IStandardGraphModel. More...
 
SMARTENGINE_EXPORT ObjectPtr< IGraphModelCreateUserGraphModel (const UserGraphModelCInfo &cinfo)
 Creates an overridable instance if IGraphModel More...
 
SMARTENGINE_EXPORT ObjectPtr< IGraphManagerCreateGraphManager (const GraphManagerCInfo &cinfo)
 Creates an instance of IGraphManager. More...
 
SMARTENGINE_EXPORT HashKey HashString (const char *str)
 
SMARTENGINE_EXPORT bool SetSmartEngineLicense (const byte *data, int64 count)
 Loads a license from a license file blob. Call this before creating a context if you want to load a license from other than the default location. More...
 
SMARTENGINE_EXPORT void SetLogHandler (LogHandler handler)
 Used to set the handler for log output from the SmartEngine AI plugin More...
 
SMARTENGINE_EXPORT ObjectPtr< ILossCreateLoss (const LossCInfo &cinfo)
 Creates an instance of ILoss. More...
 
SMARTENGINE_EXPORT ObjectPtr< IMatrixCreateMatrix (MatrixIndex rows, MatrixIndex cols)
 Creates an instance of IMatrix More...
 
SMARTENGINE_EXPORT ObjectPtr< IMemoryBufferCreateMemoryBuffer ()
 Creates an instance of IMemoryBuffer More...
 
SMARTENGINE_EXPORT ObjectPtr< INeuronLayerCreateNeuronLayer (const NeuronLayerCInfo &cinfo)
 Creates an instance of INeuronLayer More...
 
template<typename D >
ObjectPtr< D > DynamicCast (IObject *p)
 Safe cast an IObject to a pointer of a different type. More...
 
template<typename D >
ObjectPtr< D > DynamicCast (const IObject *p)
 Safe cast an IObject to a pointer of a different type. More...
 
template<typename D >
ObjectPtr< D > DynamicCastAttach (IObject *p)
 Safe cast an IObject to a pointer of a different type. Does not call AddRef() on the interface. More...
 
template<typename D >
ObjectPtr< D > IsA (IObject *p)
 
SMARTENGINE_EXPORT ObjectPtr< IParameterCreateParameter (const ParameterCInfo &cinfo)
 Creates an instance of IParameter More...
 
SMARTENGINE_EXPORT ObjectPtr< IPoolingLayerCreatePoolingLayer (const PoolingLayerCInfo &cinfo)
 Creates an instance of IPoolingLayer More...
 
SMARTENGINE_EXPORT ObjectPtr< IUnpoolingLayerCreateUnpoolingLayer (const UnpoolingLayerCInfo &cinfo)
 Creates an instance of IUnpoolingLayer More...
 
SMARTENGINE_EXPORT ObjectPtr< IPPOTrainerCreatePPOTrainer (const PPOTrainerCInfo &cinfo)
 Creates an instance of IPPOTrainer More...
 

Variables

const float cUpdateEveryFrameRate = 0.0f
 An update rate set to this value means we should update the controller with model output every frame. More...
 
const float cUpdateManuallyRate = -1.0f
 An update rate set to this value means we shouldn't update the controller automatically, but rather only when UpdateControllerImmediately() is called. More...
 
const float cDefaultUpdateRate = -2.0f
 Use the model's default update rate. Not valid when registering a model. This is the only value that can be used to group controllers to the same network. More...
 

Typedef Documentation

◆ Agent_EndEpisode_Ptr

typedef void(SMARTENGINE_CALLBACK * SmartEngine::Agent_EndEpisode_Ptr) (void *userData)

◆ Agent_GiveReward_Ptr

typedef void(SMARTENGINE_CALLBACK * SmartEngine::Agent_GiveReward_Ptr) (void *userData, float reward)

◆ Agent_RecordAction_Ptr

typedef void(SMARTENGINE_CALLBACK * SmartEngine::Agent_RecordAction_Ptr) (void *userData, const char *actionName, const float *buffer, int64 bufferCount)

◆ Agent_RecordObservation_Ptr

typedef void(SMARTENGINE_CALLBACK * SmartEngine::Agent_RecordObservation_Ptr) (void *userData, const char *inputName, const float *buffer, int64 bufferCount)

◆ Agent_StartNewExperience_Ptr

typedef void(SMARTENGINE_CALLBACK * SmartEngine::Agent_StartNewExperience_Ptr) (void *userData)

◆ AssetStoreHandler

typedef bool(* SmartEngine::AssetStoreHandler) (const char *assetName, AssetType assetType, IMemoryBuffer *buffer)

◆ GraphModel_AddData_Ptr

typedef void(SMARTENGINE_CALLBACK * SmartEngine::GraphModel_AddData_Ptr) (void *userData, const char *nodeName, ObjPtr data)

◆ GraphModel_ClearData_Ptr

typedef void(SMARTENGINE_CALLBACK * SmartEngine::GraphModel_ClearData_Ptr) (void *userData)

◆ GraphModel_Execute_Ptr

typedef void(SMARTENGINE_CALLBACK * SmartEngine::GraphModel_Execute_Ptr) (void *userData)

◆ GraphModel_RequestOutput_Ptr

typedef void(SMARTENGINE_CALLBACK * SmartEngine::GraphModel_RequestOutput_Ptr) (void *userData, int controllerId, const char *nodeName, int64 expectedRowCount)

◆ GraphModel_Reset_Ptr

typedef void(SMARTENGINE_CALLBACK * SmartEngine::GraphModel_Reset_Ptr) (void *userData)

◆ GraphModel_RetrieveOutput_Ptr

typedef void(SMARTENGINE_CALLBACK * SmartEngine::GraphModel_RetrieveOutput_Ptr) (void *userData, int controllerId, ObjPtr modelOut)

◆ HashKey

typedef unsigned int SmartEngine::HashKey

◆ MatrixIndex

using SmartEngine::MatrixIndex = typedef StrongNumber<struct MatrixIndexParam, std::ptrdiff_t>

◆ ObjectClassId

typedef unsigned int SmartEngine::ObjectClassId

◆ ObjectId

typedef int64 SmartEngine::ObjectId

Enumeration Type Documentation

◆ ActivationType

enum SmartEngine::ActivationType : byte
strong

The activation function to apply to the output of the NeuronLayer

Enumerator
None 

No activation

Sigmoid 

Maps output into the range [0..1]

Tanh 

Maps output into the range [-1..1]

Relu 

max(x, 0)

Relu6 

min(max(x, 0), 6)

LeakyRelu 

Similar to Relu, but allows for scaled negative values

Softmax 

Converts the outputs into weighted probabilities.

Elu 

Similar to Relu, but uses an exponential for negative values

Selu 

Similar to Relu, but uses an exponential for negative values. Positive values are scaled. Best when training with gradient descent. The inputs to the network should be be in the [-2..2] range.

Softplus 

Maps output into a positive number

Normalize 

Treats each row as a vector that is to have total length 1.0

If the length of the row is 0.0, the row is unchanged

NormalizeAllowSmallLengths 

Treats each row as a vector. Vector lengths greater than 1.0 will be normalized to length 1.0. Vector lengths less than 1.0 will be passed unchanged.

Count 

◆ AssetType

enum SmartEngine::AssetType : byte
strong
Enumerator
JsonString 

The memory buffer will be filled or should be filled with just a single string that is the content of the asset.

Binary 

The memory buffer will be filled or should be filled with the raw bytes from the content of the asset.

Count 

◆ ChoiceType

enum SmartEngine::ChoiceType : byte
strong

Defines the descision algorithm of the ChoiceNode

Enumerator
Random 

Treat the output as a probability distribution and sample from that distribution on each evaulation. Returns the index of the chosen output.

Max 

Return the index of the output with the highest value.

Count 

◆ Conv2DType

enum SmartEngine::Conv2DType : byte
strong
Enumerator
Conv2D 

2D Convolution layer, no bias

Conv2DWithBias 

2D Convolution layer, with bias

Conv2DTranspose 

2D Transpose convolution layer (sometimes called deconvolution), no bias

Conv2DTransposeWithBias 

2D Transpose convolution layer (sometimes called deconvolution), with bias

Count 

◆ DeviceType

enum SmartEngine::DeviceType : byte
strong

The type of context to create.

Enumerator
Default 

Chooses the best device for the current system.

Cpu 

Train and evaulate using only the CPU.

Gpu 

Train and evaulate using only the GPU.

◆ GeneSwapTarget

enum SmartEngine::GeneSwapTarget : byte
strong
Enumerator
Weight 

Swapping occurs at the individual weight level across all neurons.

Neuron 

Swapping applies to all weights in a neuron.

◆ GeneticAgentScoringMethod

Defines how the trainer deals with chromosome scores from multiple agents.

Enumerator
Sum 

Sum the scores of all agents associated with the chromosome

Average 

Average the scores of all agents associated with the chromosome

◆ GradientDescentTrainingAlgorithm

Enumerator
Adam 

Good default choice

AdaMax 

Can be more stable in certain circumstances, such as RL training

◆ LayerType

enum SmartEngine::LayerType : byte
strong

The type of layer to create

Enumerator
LinearNoBias 

Linear with no bias (X * W)

Linear 

Linear with bias (X * W + B)

LSTM 

Long short term memory layer

Count 

◆ LogLevel

enum SmartEngine::LogLevel
strong
Enumerator
Info 

Diagnostic or informational messages

Warning 

Warning - recoverable error

Error 

Unrecoverable error

Count 

◆ LossTrainingMethod

enum SmartEngine::LossTrainingMethod : byte
strong
Enumerator
WholeDataset 

Train against all data in the buffer in groups of size BatchSize.

Stochastic 

Train by random sampling of the input data in groups of size BatchSize.

◆ MutationTarget

enum SmartEngine::MutationTarget : byte
strong
Enumerator
Auto 

Chooses the default value depending on the node type.

Weight 

Mutation occurs at the individual weight level across all neurons.

Neuron 

Mutation applies to all weights in a neuron.

◆ PoolType

enum SmartEngine::PoolType : byte
strong
Enumerator
Max 

Outputs the maximum value of the block of inputs

Average 

Takes the average value of the block of inputs

Count 

◆ SerializationResult

Enumerator
Success 
UnspecifiedError 
EndOfStream 
NotSupported 
Corrupted 
VersionTooLow 
InvalidResourceName 
InvalidObject 
InvalidBuffer 
InvalidInput 
InputCountMismatch 
InputDimensionMismatch 
TensorCountMismatch 
TensorSizeMismatch 
TensorDataSizeMismatch 
NodeCountMismatch 
NodeNotFound 
FileNotFound 
SignatureNotValid 
LicenseExpired 
InvalidGraphDefinition 

Function Documentation

◆ CreateA2CTrainer()

SMARTENGINE_EXPORT ObjectPtr<IA2CTrainer> SmartEngine::CreateA2CTrainer ( const A2CTrainerCInfo cinfo)

Creates an instance of IA2CTrainer

◆ CreateActivationNode()

SMARTENGINE_EXPORT ObjectPtr<IGraphNode> SmartEngine::CreateActivationNode ( const ActivationNodeCInfo cinfo)

Applies an activation function to the input.

◆ CreateAgentDataStore()

SMARTENGINE_EXPORT ObjectPtr<IAgentDataStore> SmartEngine::CreateAgentDataStore ( const AgentDataStoreCInfo cinfo)

Creates an instance of IAgentDataStore

◆ CreateBufferInput()

SMARTENGINE_EXPORT ObjectPtr<IBufferInput> SmartEngine::CreateBufferInput ( const BufferInputCInfo cinfo)

Creates an instance of IBufferInput

◆ CreateChoiceNode()

SMARTENGINE_EXPORT ObjectPtr<IGraphNode> SmartEngine::CreateChoiceNode ( const ChoiceNodeCInfo cinfo)

Returns a random choice (as an integer) from the input node's probability distribution on each call to RetrieveOutput().

◆ CreateComponentInput()

SMARTENGINE_EXPORT ObjectPtr<IComponentInput> SmartEngine::CreateComponentInput ( const ComponentInputCInfo cinfo)

Creates an instance of IComponentInput

◆ CreateConcatNode()

SMARTENGINE_EXPORT ObjectPtr<IGraphNode> SmartEngine::CreateConcatNode ( const ConcatNodeCInfo cinfo)

Merges two or more node streams into one. Each input stream must have the same number of rows. The output dimension is the sum of the input dimensions.

◆ CreateContext()

SMARTENGINE_EXPORT ObjectPtr<IContext> SmartEngine::CreateContext ( DeviceType  device = DeviceType::Default)

Creates a context using the specified device.

◆ CreateConv2DLayer()

SMARTENGINE_EXPORT ObjectPtr<IConv2DLayer> SmartEngine::CreateConv2DLayer ( const Conv2DLayerCInfo cinfo)

Creates an instance of IConv2DLayer

◆ CreateCuriosityModule()

SMARTENGINE_EXPORT ObjectPtr<ICuriosityModule> SmartEngine::CreateCuriosityModule ( const CuriosityModuleCInfo cinfo)

Creates an instance of IA2CTrainer

◆ CreateD4PGTrainer()

SMARTENGINE_EXPORT ObjectPtr<ID4PGTrainer> SmartEngine::CreateD4PGTrainer ( const D4PGTrainerCInfo cinfo)

Creates an instance of ID4PGTrainer

◆ CreateEmptyGraph()

SMARTENGINE_EXPORT ObjectPtr<IGraph> SmartEngine::CreateEmptyGraph ( const GraphCInfo cinfo)

Creates a new, empty IGraph instance.

◆ CreateExtractNode()

SMARTENGINE_EXPORT ObjectPtr<IGraphNode> SmartEngine::CreateExtractNode ( const ExtractNodeCInfo cinfo)

Extracts a subset of columns from the input node. The start index + column count must not exceed the output dimension of the input node.

◆ CreateGeneticAgentTrainer()

SMARTENGINE_EXPORT ObjectPtr<IGeneticAgentTrainer> SmartEngine::CreateGeneticAgentTrainer ( const GeneticAgentTrainerCInfo cinfo)

Creates an instance of IGeneticAgentTrainer

◆ CreateGeneticTrainer()

SMARTENGINE_EXPORT ObjectPtr<IGeneticTrainer> SmartEngine::CreateGeneticTrainer ( const GeneticTrainerCInfo cinfo)

Creates an instance of IGeneticTrainer

◆ CreateGradientDescentTrainer()

SMARTENGINE_EXPORT ObjectPtr<IGradientDescentTrainer> SmartEngine::CreateGradientDescentTrainer ( const GradientDescentTrainerCInfo cinfo)

Creates an instance of IGradientDescentTrainer

◆ CreateGraphComponent()

SMARTENGINE_EXPORT ObjectPtr<IGraphComponent> SmartEngine::CreateGraphComponent ( const GraphComponentCInfo cinfo)

Creates an instance of IGraphComponent

◆ CreateGraphController()

SMARTENGINE_EXPORT ObjectPtr<IGraphController> SmartEngine::CreateGraphController ( const GraphControllerCInfo cinfo)

Creates an instance of IGraphController.

◆ CreateGraphFromDefinition()

SMARTENGINE_EXPORT ObjectPtr<IGraph> SmartEngine::CreateGraphFromDefinition ( const GraphCInfo cinfo,
const char *  graphDefinition 
)

Creates a new IGraph from a graph definition json string.

◆ CreateGraphFromResource()

SMARTENGINE_EXPORT ObjectPtr<IGraph> SmartEngine::CreateGraphFromResource ( const GraphCInfo cinfo,
const char *  resourceName = nullptr 
)

Creates and loads a new IGraph from a resource.

◆ CreateGraphManager()

SMARTENGINE_EXPORT ObjectPtr<IGraphManager> SmartEngine::CreateGraphManager ( const GraphManagerCInfo cinfo)

Creates an instance of IGraphManager.

◆ CreateLoss()

SMARTENGINE_EXPORT ObjectPtr<ILoss> SmartEngine::CreateLoss ( const LossCInfo cinfo)

Creates an instance of ILoss.

◆ CreateMatrix()

SMARTENGINE_EXPORT ObjectPtr<IMatrix> SmartEngine::CreateMatrix ( MatrixIndex  rows,
MatrixIndex  cols 
)

Creates an instance of IMatrix

◆ CreateMaximumNode()

SMARTENGINE_EXPORT ObjectPtr<IGraphNode> SmartEngine::CreateMaximumNode ( const MaximumNodeCInfo cinfo)

Takes the maximum of the inputs.

◆ CreateMemoryBuffer()

SMARTENGINE_EXPORT ObjectPtr<IMemoryBuffer> SmartEngine::CreateMemoryBuffer ( )

Creates an instance of IMemoryBuffer

◆ CreateMinimumNode()

SMARTENGINE_EXPORT ObjectPtr<IGraphNode> SmartEngine::CreateMinimumNode ( const MinimumNodeCInfo cinfo)

Takes the minimum of the inputs.

◆ CreateMultiplexerNode()

SMARTENGINE_EXPORT ObjectPtr<IGraphNode> SmartEngine::CreateMultiplexerNode ( const MultiplexerNodeCInfo cinfo)

Uses the value from the selector to decide which of the inputs to pass through. The selected input will be transmitted without adjustment. Each input should have the same dimension. The selector should have a dimension of 1 and a sigmoid activation.

Note: The selector input nor its subgraph can be trained through gradient descent or reinforcement learning.

◆ CreateNeuronLayer()

SMARTENGINE_EXPORT ObjectPtr<INeuronLayer> SmartEngine::CreateNeuronLayer ( const NeuronLayerCInfo cinfo)

Creates an instance of INeuronLayer

◆ CreateNormalNode()

SMARTENGINE_EXPORT ObjectPtr<IGraphNode> SmartEngine::CreateNormalNode ( const NormalNodeCInfo cinfo)

Returns a random value from the normal distribution given by the input nodes. NOTE: Input takes in the variance and not the standard deviation.

◆ CreateParameter()

SMARTENGINE_EXPORT ObjectPtr<IParameter> SmartEngine::CreateParameter ( const ParameterCInfo cinfo)

Creates an instance of IParameter

◆ CreatePoolingLayer()

SMARTENGINE_EXPORT ObjectPtr<IPoolingLayer> SmartEngine::CreatePoolingLayer ( const PoolingLayerCInfo cinfo)

Creates an instance of IPoolingLayer

◆ CreatePPOTrainer()

SMARTENGINE_EXPORT ObjectPtr<IPPOTrainer> SmartEngine::CreatePPOTrainer ( const PPOTrainerCInfo cinfo)

Creates an instance of IPPOTrainer

◆ CreateStandardGraphModel()

SMARTENGINE_EXPORT ObjectPtr<IStandardGraphModel> SmartEngine::CreateStandardGraphModel ( const StandardGraphModelCInfo cinfo)

Creates an instance of IStandardGraphModel.

◆ CreateStopGradientNode()

SMARTENGINE_EXPORT ObjectPtr<IGraphNode> SmartEngine::CreateStopGradientNode ( const StopGradientNodeCInfo cinfo)

Stops the gradient from flowing backwards from this point. Only meaningful when training with gradient descent or reinforcement learning.

◆ CreateUnpoolingLayer()

SMARTENGINE_EXPORT ObjectPtr<IUnpoolingLayer> SmartEngine::CreateUnpoolingLayer ( const UnpoolingLayerCInfo cinfo)

Creates an instance of IUnpoolingLayer

◆ CreateUserAgent()

SMARTENGINE_EXPORT ObjectPtr<IAgent> SmartEngine::CreateUserAgent ( const UserAgentCInfo cinfo)

Creates an overridable instance of IAgent from a previously serialized agent.

◆ CreateUserGraphModel()

SMARTENGINE_EXPORT ObjectPtr<IGraphModel> SmartEngine::CreateUserGraphModel ( const UserGraphModelCInfo cinfo)

Creates an overridable instance if IGraphModel

◆ DynamicCast() [1/2]

template<typename D >
ObjectPtr<D> SmartEngine::DynamicCast ( const IObject p)

Safe cast an IObject to a pointer of a different type.

◆ DynamicCast() [2/2]

template<typename D >
ObjectPtr<D> SmartEngine::DynamicCast ( IObject p)

Safe cast an IObject to a pointer of a different type.

◆ DynamicCastAttach()

template<typename D >
ObjectPtr<D> SmartEngine::DynamicCastAttach ( IObject p)

Safe cast an IObject to a pointer of a different type. Does not call AddRef() on the interface.

◆ HashString()

SMARTENGINE_EXPORT HashKey SmartEngine::HashString ( const char *  str)

◆ IsA()

template<typename D >
ObjectPtr<D> SmartEngine::IsA ( IObject p)

◆ SetAssetStoreHandlers()

SMARTENGINE_EXPORT void SmartEngine::SetAssetStoreHandlers ( AssetStoreHandler  loadHandler,
AssetStoreHandler  saveHandler 
)

Used to set the handler for custom loading and saving of assets.

◆ SetLogHandler()

SMARTENGINE_EXPORT void SmartEngine::SetLogHandler ( LogHandler  handler)

Used to set the handler for log output from the SmartEngine AI plugin

◆ SetSmartEngineLicense()

SMARTENGINE_EXPORT bool SmartEngine::SetSmartEngineLicense ( const byte *  data,
int64  count 
)

Loads a license from a license file blob. Call this before creating a context if you want to load a license from other than the default location.

Parameters
data

Variable Documentation

◆ cDefaultUpdateRate

const float SmartEngine::cDefaultUpdateRate = -2.0f

Use the model's default update rate. Not valid when registering a model. This is the only value that can be used to group controllers to the same network.

◆ cUpdateEveryFrameRate

const float SmartEngine::cUpdateEveryFrameRate = 0.0f

An update rate set to this value means we should update the controller with model output every frame.

◆ cUpdateManuallyRate

const float SmartEngine::cUpdateManuallyRate = -1.0f

An update rate set to this value means we shouldn't update the controller automatically, but rather only when UpdateControllerImmediately() is called.