NeuralEngine A Game Engine with embeded Machine Learning algorithms based on Gaussian Processes. |

FgDiscreteFactorNode.h
1
11#pragma once
12
13#include <MachineLearning/FgIFactorNode.h>
14#include <MachineLearning/FgDiscreteVariableNode.h>
15//#include <MachineLearning/FgPotential.h>
16#include <MachineLearning/FgIMessage.h>
17
18 namespace NeuralEngine
19{
20 namespace MachineLearning
21 {
31 class NE_IMPEXP DiscreteFactorNode : public IFactorNode
32 {
33 public:
34
44 DiscreteFactorNode(DiscreteVariableNode &node, std::string name);
45
54 DiscreteFactorNode(DiscreteVariableNode &node);
55
64 DiscreteFactorNode(std::vector<DiscreteVariableNode*> nodes, std::string name);
65
73 DiscreteFactorNode(std::vector<DiscreteVariableNode*> nodes);
74
80 ~DiscreteFactorNode();
81
91 virtual bool IsSupported(MsgType type);
92
101 void SetPotential(double potential, int index);
102
110 void AddPotential(double potential);
111
121 double GetPotential(int index);
122
123 //virtual void Summation();
124 protected:
139 virtual IMessage ComputeMessage(std::string toNodeName, MsgBox &neededMessages);
140
141 private:
142 //Potential p;
143 std::vector<double> vP; // flattend version of an D dimensional propability table.
144
145 friend class boost::serialization::access;
146
147 template<class Archive>
148 void serialize(Archive& ar, unsigned int version)
149 {
150 ar & boost::serialization::base_object<IFactorNode>(*this);
151 ar& BOOST_SERIALIZATION_NVP(vP);
152 }
153 };
154 }
155}
NeuralEngine::MachineLearning::DiscreteFactorNode
Base Class INode.
Definition: FgDiscreteFactorNode.h:32
NeuralEngine::MachineLearning::DiscreteFactorNode::DiscreteFactorNode
DiscreteFactorNode(std::vector< DiscreteVariableNode * > nodes)
Constructor.
NeuralEngine::MachineLearning::DiscreteFactorNode::AddPotential
void AddPotential(double potential)
Adds a potential.
NeuralEngine::MachineLearning::DiscreteFactorNode::SetPotential
void SetPotential(double potential, int index)
Sets a potential at given index.
NeuralEngine::MachineLearning::DiscreteFactorNode::IsSupported
virtual bool IsSupported(MsgType type)
Query if message type is supported.
NeuralEngine::MachineLearning::DiscreteFactorNode::ComputeMessage
virtual IMessage ComputeMessage(std::string toNodeName, MsgBox &neededMessages)
Calculate a message to connectd node.
NeuralEngine::MachineLearning::DiscreteFactorNode::DiscreteFactorNode
DiscreteFactorNode(DiscreteVariableNode &node, std::string name)
Default constructor.
NeuralEngine::MachineLearning::DiscreteFactorNode::GetPotential
double GetPotential(int index)
Gets a potential.
NeuralEngine::MachineLearning::DiscreteFactorNode::DiscreteFactorNode
DiscreteFactorNode(DiscreteVariableNode &node)
Constructor.
NeuralEngine::MachineLearning::DiscreteFactorNode::~DiscreteFactorNode
~DiscreteFactorNode()
Destructor.
NeuralEngine::MachineLearning::DiscreteFactorNode::DiscreteFactorNode
DiscreteFactorNode(std::vector< DiscreteVariableNode * > nodes, std::string name)
Constructor.
NeuralEngine::MachineLearning::DiscreteVariableNode
Class Discrete Variable Node.
Definition: FgDiscreteVariableNode.h:30
NeuralEngine::MachineLearning::IFactorNode
Definition: FgIFactorNode.h:21
NeuralEngine::MachineLearning::IMessage
Definition: FgIMessage.h:27
NeuralEngine
Definition: NeArray2.h:18