Ejemplo n.º 1
0
        static void ModelNetworkSprinklerFile()
        {
            GraphicalModel model = new GraphicalModel("WetRainSprinkler.xml");

            model.CreateNetwork();
            Dictionary <string, int[]> observedData = GraphicalModel.LoadData("WetRainSprinklerData.xml");

            model.LearnParameters(observedData);
        }
Ejemplo n.º 2
0
        static void CreateGraphicalModel()
        {
            GraphicalModel model = new GraphicalModel("dungeonNetwork.xml");

            model.CreateNetwork();
            Dictionary <string, int[]> observedData = GraphicalModel.LoadData("dungeonNetworkData.xml");

            model.LearnParameters(observedData);
        }
Ejemplo n.º 3
0
        public NonSharedGraphicalModel(GraphicalModel original)
        {
            foreach (var node in original.nodes)
            {
                nodes[node.Key] = new ModelNodeNonShared(node.Value);
            }
            foreach (var node in original.independentNodes)
            {
                independentNodes[node.Key] = nodes[node.Key];
            }

            foreach (var node in original.nodes)
            {
                foreach (var parent in node.Value.parents)
                {
                    AddLink(nodes[parent.name], nodes[node.Key]);
                }
            }
            NumberOfExamples = Variable.New <int>().Named("NofE");
            N = new Range(NumberOfExamples).Named("N");
            //  CreateNetwork();
        }