different results for Genie and Smile
different results for Genie and Smile
Hi,
I'm playing with Genie and Smile to understand that stuff.
I modelled a BN in Genie und load it into SMILE by .dsl format.
I set the identical evidence (soft).
In Genie it's the clustering I use and in Smile the first algorithmn should be the adequate (index 0, lauritzen), right?
The values in my targets are different.
Thanks
techmec
I'm playing with Genie and Smile to understand that stuff.
I modelled a BN in Genie und load it into SMILE by .dsl format.
I set the identical evidence (soft).
In Genie it's the clustering I use and in Smile the first algorithmn should be the adequate (index 0, lauritzen), right?
The values in my targets are different.
Thanks
techmec
Re: different results for Genie and Smile
Hi Techmec,
How and where did you set the evidence?
btw. are you using the .xdsl format? the .dsl format is actually older and not really used anymore.
Best,
Martijn
How and where did you set the evidence?
btw. are you using the .xdsl format? the .dsl format is actually older and not really used anymore.
Best,
Martijn
Re: different results for Genie and Smile
Hi Martijn,
I'm using dsl only because I got an error when I initially tried xdsl. I thought it doesn't matter. I think I retry that.
The evidence is set as soft evidence.
Setting the evidence is done by node->value->setsoftevidence, with the double std::vector.
And the a-priori by using setDefinition(), with a DSL_doublearray.
I proofed that, the values have been set.
I just set the Algorithmtype, set the evidence and then call UpdateBeliefs();
Greetz,
techmec
I'm using dsl only because I got an error when I initially tried xdsl. I thought it doesn't matter. I think I retry that.
The evidence is set as soft evidence.
Setting the evidence is done by node->value->setsoftevidence, with the double std::vector.
And the a-priori by using setDefinition(), with a DSL_doublearray.
I proofed that, the values have been set.
I just set the Algorithmtype, set the evidence and then call UpdateBeliefs();
Greetz,
techmec
Re: different results for Genie and Smile
How do the results differ?
Are they big, or small, could they be rounding errors?
Are they big, or small, could they be rounding errors?
Re: different results for Genie and Smile
Hi,
when I use the SMILE lib the outcomes of the targets vary just between 0.25 and 0.28. The most are very very close together.
In the GENIE application the values vary (with same evidence set) between 0.20 and 0.70.
when I use the SMILE lib the outcomes of the targets vary just between 0.25 and 0.28. The most are very very close together.
In the GENIE application the values vary (with same evidence set) between 0.20 and 0.70.
Re: different results for Genie and Smile
What does the code look like exactly?
Re: different results for Genie and Smile
Okay, well.
I now saved the net as xdsl.
If I save the net which I use in SMILE after setting the a-priori informations (setDefinition), and then load the net into Genie, both nets work identically.
So what is left... the setting of the evidence. As I cannot save it, I can't proof it in GENIE.
Code?
The cutoffvalue is the evidence, scaled (If I'm sure it's 1.0, if not so much 0.8 and so on)
Seems to be a self-made problem, or?
I now saved the net as xdsl.
If I save the net which I use in SMILE after setting the a-priori informations (setDefinition), and then load the net into Genie, both nets work identically.
So what is left... the setting of the evidence. As I cannot save it, I can't proof it in GENIE.
Code?
Code: Select all
int index= BNStorage[which]->net.FindNode("my_Color");
if (index>=0){
DSL_node* node=BNStorage[which]->net.GetNode(index);
std::vector<double > f;
for (int i=0;i<possibleColors;i++) f.push_back((1.0-cutoffvalue)/possibleColors-1);
f[statenumber]=cutoffvalue;
node->Value()->SetSoftEvidence(f);
}
Seems to be a self-made problem, or?
Re: different results for Genie and Smile
Are you sure about what you put in f?
(1.0-cutoffvalue)/possibleColors-1
is the 1.0-cutoffvalue supposed to be divided by possibleColors or possibleColors-1?
(1.0-cutoffvalue)/possibleColors-1
is the 1.0-cutoffvalue supposed to be divided by possibleColors or possibleColors-1?
Re: different results for Genie and Smile
Should be ok.
I want to set the value for experimental usage as 1.0, 0.8, 0.6 and so on to look how "sure" I have to be to get the right target in the end.
The rest of the values should be uniform, but of course they have to sum up to 1.
I want to set the value for experimental usage as 1.0, 0.8, 0.6 and so on to look how "sure" I have to be to get the right target in the end.
The rest of the values should be uniform, but of course they have to sum up to 1.
Re: different results for Genie and Smile
I'm very glad that you try to help me thanks for that
Re: different results for Genie and Smile
Ok, but this -1 at the end could be an issue
If your cutoff is say 1.0 then the other should be 0
(1-1)/3 -1 = -1
or
0/(3-1) = 0/2 = 0
Same for 0.6
(1-0.6)/3 -1 = (0.4)/3 -1 = -0.87
or
(1-0.6)/(3-1) = 0.4/2 = 0.2
It does make a difference
So are you sure about this?
If your cutoff is say 1.0 then the other should be 0
(1-1)/3 -1 = -1
or
0/(3-1) = 0/2 = 0
Same for 0.6
(1-0.6)/3 -1 = (0.4)/3 -1 = -0.87
or
(1-0.6)/(3-1) = 0.4/2 = 0.2
It does make a difference
So are you sure about this?
Re: different results for Genie and Smile
OH, I'm sorry.
In my code its a real number not a variable.
I only posted it as variable, because I thought it explains itself better.
My fault.
Otherwise you are clearly right.
In my code its a real number not a variable.
I only posted it as variable, because I thought it explains itself better.
My fault.
Otherwise you are clearly right.
Re: different results for Genie and Smile
Ok, I see.
So, just to make sure everything is completely clear, could you post the code segment as it is exactly?
So, just to make sure everything is completely clear, could you post the code segment as it is exactly?
Re: different results for Genie and Smile
OK
Code: Select all
case 1:{
int index=BNStorage[which]->theNet.FindNode("pxisColor");
if (index>=0){
DSL_node* node=BNStorage[which]->theNet.GetNode(index);
std::vector<double> f;
for (int i=0;i<13;i++)f.push_back(1.0-cutoffinput)/12.0);
f[state]=cutoffinput;
node->Value()->SetSoftEvidence(f);
//proof
node->Value()->GetSoftEvidence(f);
for (int i=0;i<f.size();i++)
cout<<""<<f[i]<<endl;
}
}break;
case 2:
int index=BNStorage[which]->theNet.FindNode("regionisColor");
if (index>=0){
DSL_node* node=BNStorage[which]->theNet.GetNode(index);
std::vector<double> f;
f.push_back(cutoffinput);f.push_back(1.0-cutoffinput);
node->Value()->SetSoftEvidence(f);
}
}break;
Re: different results for Genie and Smile
Ok.
Can you summarize the whole procedure for both your code and Genie?
Is it basically:
1. Set evidence for a number of nodes (for how many nodes, do you set soft evidence?, how many nodes do not receive any evidence?)
2. Run inference
3. Check probabilities (how do you check them in the code? how in Genie?)
I'm trying to understand the whole thing to see where things could go wrong.
Best,
Martijn
Can you summarize the whole procedure for both your code and Genie?
Is it basically:
1. Set evidence for a number of nodes (for how many nodes, do you set soft evidence?, how many nodes do not receive any evidence?)
2. Run inference
3. Check probabilities (how do you check them in the code? how in Genie?)
I'm trying to understand the whole thing to see where things could go wrong.
Best,
Martijn