NeuralEngine
A Game Engine with embeded Machine Learning algorithms based on Gaussian Processes.
NeuralEngine::MachineLearning::DiscreteVariableNode Class Reference

Class Discrete Variable Node. More...

#include <FgDiscreteVariableNode.h>

Inheritance diagram for NeuralEngine::MachineLearning::DiscreteVariableNode:
Collaboration diagram for NeuralEngine::MachineLearning::DiscreteVariableNode:

Public Member Functions

 DiscreteVariableNode (std::string name, int numStates)
 Constructor. More...
 
 ~DiscreteVariableNode ()
 Destructor. More...
 
virtual bool IsSupported (MsgType type)
 Query if message type is supported. More...
 
bool IsLeafNode ()
 Query if this object is leaf node. More...
 
virtual af::array & Marginal (MsgBox &neededMessages)
 Marginal propability of the node. More...
 
- Public Member Functions inherited from NeuralEngine::MachineLearning::IVariableNode
 IVariableNode (std::string name, int numStates)
 Constructor. More...
 
 ~IVariableNode ()
 Destructor. More...
 
int NumStates ()
 Gets the dimension of the node. More...
 
virtual bool IsSupported (MsgType type)=0
 Query if message type is supported. More...
 
- Public Member Functions inherited from NeuralEngine::MachineLearning::INode
 INode (std::string name)
 Default constructor. More...
 
 ~INode ()
 Destructor. More...
 
std::string Name ()
 Gets the name. More...
 
virtual void SendMsg (std::string toNodeName)
 Sends a message. More...
 
virtual void ReceiveMsg (std::string fromNodeName, IMessage &message)
 Receives a message. More...
 
virtual void AddIncoming (INode *node)
 Adds ingoing connection to the node. More...
 
virtual void AddOutgoing (INode *node)
 Adds outgoing connection to the node. More...
 
virtual void AddConnection (INode *node, const std::string &tag)
 Adds a custom connection with the given tag. More...
 
virtual bool IsSupported (MsgType type)=0
 Query if message type is supported. More...
 
const MsgBox & GetAllMessages () const
 Gets all the messages of this node. More...
 
void ClearMessages ()
 Clears all incomming messages for next iteration. More...
 

Protected Member Functions

virtual IMessage ComputeMessage (std::string toNodeName, MsgBox &neededMessages)
 Custom message computation for specific node. More...
 
virtual IMessage ComputeMessage (std::string toNodeName, MsgBox &neededMessages)=0
 Calculate a message to connectd node. More...
 
- Protected Member Functions inherited from NeuralEngine::MachineLearning::INode
void SetMessage (std::string fromNodeName, IMessage &msg)
 Sets a incomming message from specific node. More...
 
virtual IMessage ComputeMessage (std::string fromNodeName, MsgBox &neededMessages)=0
 Virtual function to calculate a message to connectd node. More...
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, unsigned int version)
 

Friends

class boost::serialization::access
 

Additional Inherited Members

- Protected Attributes inherited from NeuralEngine::MachineLearning::INode
std::map< std::string, INode * > mNodes
 
MsgBox mMessageBox
 
std::set< std::string > sIncomming
 
std::set< std::string > sOutgoing
 
std::map< std::string, std::string > mConnections
 

Detailed Description

Class Discrete Variable Node.

Basic functionalities of a Node in a Factor Graph.

Admin, 7/24/2017.

Definition at line 29 of file FgDiscreteVariableNode.h.

Constructor & Destructor Documentation

◆ DiscreteVariableNode()

NeuralEngine::MachineLearning::DiscreteVariableNode::DiscreteVariableNode ( std::string  name,
int  numStates 
)

Constructor.

Hmetal T, 09.08.2017.

Parameters
nameThe name.
IDThe identifier.
numStatesNumber of states.

◆ ~DiscreteVariableNode()

NeuralEngine::MachineLearning::DiscreteVariableNode::~DiscreteVariableNode ( )

Destructor.

Admin, 7/24/2017.

Member Function Documentation

◆ IsSupported()

virtual bool NeuralEngine::MachineLearning::DiscreteVariableNode::IsSupported ( MsgType  type)
virtual

Query if message type is supported.

Admin, 7/25/2017.

Parameters
typeThe message type.
Returns
true if supported, false if not.

Implements NeuralEngine::MachineLearning::IVariableNode.

◆ IsLeafNode()

bool NeuralEngine::MachineLearning::DiscreteVariableNode::IsLeafNode ( )

Query if this object is leaf node.

Hmetal T, 07.08.2017.

Returns
true if leaf node, false if not.

◆ Marginal()

virtual af::array & NeuralEngine::MachineLearning::DiscreteVariableNode::Marginal ( MsgBox &  neededMessages)
virtual

Marginal propability of the node.

Hmetal T, 07.08.2017.

Parameters
neededMessages[in,out] The needed messages.
Returns
A reference to an af::array.

◆ ComputeMessage()

virtual IMessage NeuralEngine::MachineLearning::DiscreteVariableNode::ComputeMessage ( std::string  toNodeName,
MsgBox &  neededMessages 
)
protectedvirtual

Custom message computation for specific node.

Admin, 8/15/2017.

Parameters
toNodeNameIdentifier for receiver node.
neededMessagesAll incomming messages, exept from receiver node.
Returns
An IMessage.

Implements NeuralEngine::MachineLearning::IVariableNode.

◆ serialize()

template<class Archive >
void NeuralEngine::MachineLearning::DiscreteVariableNode::serialize ( Archive &  ar,
unsigned int  version 
)
inlineprivate

Definition at line 99 of file FgDiscreteVariableNode.h.

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 96 of file FgDiscreteVariableNode.h.


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