NeuralEngine
A Game Engine with embeded Machine Learning algorithms based on Gaussian Processes.
FgDiscreteVariableNode.h
1
11#pragma once
12
13#include <MachineLearning/FgIVariableNode.h>
14#include <MachineLearning/CommonUtil.h>
15
16namespace NeuralEngine
17{
18 namespace MachineLearning
19 {
29 class NE_IMPEXP DiscreteVariableNode : public IVariableNode
30 {
31 public:
32
42 DiscreteVariableNode(std::string name, int numStates);
43
50
60 virtual bool IsSupported(MsgType type);
61
69 bool IsLeafNode();
70
80 virtual af::array& Marginal(MsgBox& neededMessages);
81
82 protected:
93 virtual IMessage ComputeMessage(std::string toNodeName, MsgBox& neededMessages);
94
95 private:
96 friend class boost::serialization::access;
97
98 template<class Archive>
99 void serialize(Archive& ar, unsigned int version)
100 {
101 ar & boost::serialization::base_object<IVariableNode>(*this);
102 }
103 };
104 }
105}
DiscreteVariableNode(std::string name, int numStates)
Constructor.
virtual af::array & Marginal(MsgBox &neededMessages)
Marginal propability of the node.
virtual bool IsSupported(MsgType type)
Query if message type is supported.
bool IsLeafNode()
Query if this object is leaf node.
virtual IMessage ComputeMessage(std::string toNodeName, MsgBox &neededMessages)
Custom message computation for specific node.