[pyAgrum] last change in notebooks and tests to follow the new sampling inference scheme

parent ccfc2bf6
Pipeline #13634166 failed with stages
in 21 minutes and 30 seconds
......@@ -40,9 +40,8 @@
namespace gum {
/**
* GibbsKL2 computes the KL divergence betweens 2 BNs using an approximation
*pattern
*: GIBBS sampling.
* GibbsKL computes the KL divergence betweens 2 BNs using an approximation
*pattern: GIBBS sampling.
*
* KL.process() computes KL(P||Q) using klPQ() and KL(Q||P) using klQP(). The
*computations are made once. The second is for free :)
......
......@@ -42,7 +42,7 @@ from .pyAgrum import Arc, Edge, DiGraph, UndiGraph, MixedGraph, DAG, CliqueGraph
from .pyAgrum import BayesNet, EssentialGraph, MarkovBlanket
from .pyAgrum import DiscretizedVariable, LabelizedVariable, RangeVariable, DiscreteVariable
from .pyAgrum import Potential, Instantiation, UtilityTable
from .pyAgrum import BruteForceKL, GibbsSampling
from .pyAgrum import BruteForceKL, GibbsKL
from .pyAgrum import LazyPropagation, ShaferShenoyInference, VariableElimination
from .pyAgrum import LoopyBeliefPropagation, GibbsSampling, MonteCarloSampling, ImportanceSampling, WeightedSampling
from .pyAgrum import LoopyImportanceSampling,LoopyGibbsSampling,LoopyWeightedSampling
......
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
......@@ -22,25 +22,25 @@
// Author: Lionel Torti.
// ============================================================================
type t_state extends boolean
type t_state extends boolean (
OK: true,
NOK: false;
NOK: false);
type t_ink extends t_state
type t_ink extends t_state (
NotEmpty: OK,
Empty: NOK;
Empty: NOK);
type t_paper extends t_state
type t_paper extends t_state (
Ready: OK,
Jammed: NOK,
Empty: NOK;
Empty: NOK);
type t_degraded extends t_state
type t_degraded extends t_state (
OK: OK,
Dysfunctional: NOK,
Degraded: NOK;
Degraded: NOK);
int(0,5) mycount;
type mycount int(0,5);
class PowerSupply {
t_state state { [ 0.99, 0.01 ] };
......@@ -123,8 +123,8 @@ class SafeComputer implements Equipment {
}
class ParamClass {
real lambda default 0.4;
int t default 4;
param real lambda default 0.4;
param int t default 4;
Room room;
t_ink hasInk { ["lambda", "1-lambda"] };
......@@ -160,8 +160,8 @@ system aSys {
c1.printers += color_printers;
c2.printers += color_printers;
ParamClass param;
param.room = r;
ParamClass p;
p.room = r;
ParamClass paramBis(lambda=0.001);
paramBis.room = r;
......
......@@ -46,22 +46,21 @@ except:
total_errs += 1
print("=> Error in TestSuite")
if len(sys.argv) == 2 and sys.argv[1] == 'all':
if testNotebooks:
print("\n")
print("*******************")
print("Notebook Test Suite")
print("*******************")
from NotebookTestSuite import runNotebooks
if testNotebooks:
print("\n")
print("*******************")
print("Notebook Test Suite")
print("*******************")
from NotebookTestSuite import runNotebooks
try:
total_errs += runNotebooks()
except NameError:
pass
except:
total_errs += 1
print("=> Error in NotebookTestSuite")
try:
total_errs += runNotebooks()
except NameError:
pass
except:
total_errs += 1
print("=> Error in NotebookTestSuite")
print("\n\nErrors : " + str(total_errs))
print("\n\nErrors : " + str(total_errs))
sys.exit(total_errs)
......@@ -22,25 +22,25 @@
// Author: Lionel Torti.
// ============================================================================
type t_state extends boolean
type t_state extends boolean (
OK: true,
NOK: false;
NOK: false);
type t_ink extends t_state
type t_ink extends t_state (
NotEmpty: OK,
Empty: NOK;
Empty: NOK);
type t_paper extends t_state
type t_paper extends t_state (
Ready: OK,
Jammed: NOK,
Empty: NOK;
Empty: NOK);
type t_degraded extends t_state
type t_degraded extends t_state (
OK: OK,
Dysfunctional: NOK,
Degraded: NOK;
Degraded: NOK);
int(0,5) mycount;
type mycount int(0,5);
class PowerSupply {
t_state state { [ 0.99, 0.01 ] };
......@@ -123,8 +123,8 @@ class SafeComputer implements Equipment {
}
class ParamClass {
real lambda default 0.4;
int t default 4;
param real lambda default 0.4;
param int t default 4;
Room room;
t_ink hasInk { ["lambda", "1-lambda"] };
......@@ -160,8 +160,8 @@ system aSys {
c1.printers += color_printers;
c2.printers += color_printers;
ParamClass param;
param.room = r;
ParamClass p;
p.room = r;
ParamClass paramBis(lambda=0.001);
paramBis.room = r;
......
......@@ -145,7 +145,7 @@ class TestInferenceResults(SamplingTestCase):
ie = gum.LoopyWeightedSampling(self.bn)
ie.setVerbosity(True)
ie.setEpsilon(0.05)
ie.setEpsilon(0.02)
ie.setMinEpsilonRate(0.001)
msg = self.iterTest(proto, ie, self.w, {})
if msg is not None:
......@@ -158,7 +158,7 @@ class TestInferenceResults(SamplingTestCase):
ie = gum.LoopyGibbsSampling(self.bn)
ie.setVerbosity(False)
ie.setEpsilon(0.05)
ie.setEpsilon(0.02)
ie.setMinEpsilonRate(0.001)
msg = self.iterTest(proto, ie, self.w, {'s': 0, 'c': 0})
if msg is not None:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment