[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is there something wrong with the pattern flags ?



On Monday 19 March 2001 10:35, Mathias Weigt wrote:
> Servus !
> In addition to my previous mail regarding pattern flags I
> investigated this strange behaviour:
> {
> I want to implement a leave-n-out (lno) crossvalidation into a simple
> backpropagation network. I looked at the CV-example but this is only
> partly what I want to do. So I decided to write a script-environment
> to generate the different train and test environments. As a good
> starting point I took the fsa-script. }
> So I set the COMP_FLAG to a certain pattern which I want to exclude
> from training.
>
> ev->patterns[0].flag[pat] = PatternSpec::COMP_FLAG;
>
> And I wasn't happy to see that not the COMP_FLAG (16) was set
> but the TARG_EXT_FLAG (4).
>
> All in all it looks to me like there was a change to pattern-flags
> (more added) but not completely implemented (The documentation also
> mentiones less flags than available through the gui).
>
> Please correct me, if I'm totally wrong.
> (I have only little programming experiences and I am very new to
> c++/c/css).

Now I modified src/pdp/enviro_iv.cc to add the IMHO missing flags in 
EnvEditor (the linebreaks may not be correct): 
-----------
void EnvEditor::SetPatFlags(taivMenuEl* sel) { // set patflags from menu
  Apply(); // apply current settings
  int index = ((((taivHierEl *) sel)->sub_no) * 8) + sel->itm_no;
  switch (index) {
  case 0: patflags = PatternSpec::NO_FLAGS; break;
  case 8: patflags = PatternSpec::TARG_FLAG; specflags = false; break;
  case 9: patflags = PatternSpec::EXT_FLAG; specflags = false; break;
  case 10: patflags = PatternSpec::TARG_EXT_FLAG; specflags = false; 
break;
  case 11: patflags = PatternSpec::COMP_FLAG; specflags = false; break;
  case 12: patflags = PatternSpec::COMP_EXT_FLAG; specflags = false; 
break;
  case 13: patflags = PatternSpec::COMP_TARG_EXT_FLAG; specflags = 
false; break;
  case 14: patflags = PatternSpec::TARG_VALUE; specflags = false; break;
  case 15: patflags = PatternSpec::EXT_VALUE; specflags = false; break;
  case 16: patflags = PatternSpec::TARG_EXT_VALUE; specflags = false; 
break;
  case 17: patflags = PatternSpec::NO_UNIT_FLAG; specflags = false; 
break;
  case 18: patflags = PatternSpec::NO_UNIT_VALUE; specflags = false; 
break;
  case 19: patflags = PatternSpec::NO_APPLY; specflags = false; break;
  case 20: patflags = PatternSpec::TARG_FLAG; specflags = true; break;
  case 21: patflags = PatternSpec::EXT_FLAG; specflags = true; break;
  case 22: patflags = PatternSpec::TARG_EXT_FLAG; specflags = true; 
break;
  case 23: patflags = PatternSpec::COMP_FLAG; specflags = true; break;
  case 24: patflags = PatternSpec::COMP_EXT_FLAG; specflags = true; 
break;
  case 25: patflags = PatternSpec::COMP_TARG_EXT_FLAG; specflags = 
true; break;
  case 26: patflags = PatternSpec::TARG_VALUE; specflags = true; break;
  case 27: patflags = PatternSpec::EXT_VALUE; specflags = true; break;
  case 28: patflags = PatternSpec::TARG_EXT_VALUE; specflags = true; 
break;
  case 29: patflags = PatternSpec::NO_UNIT_FLAG; specflags = true; 
break;
  case 30: patflags = PatternSpec::NO_UNIT_VALUE; specflags = true; 
break;
  case 31: patflags = PatternSpec::NO_APPLY; specflags = true; break;
  }
  if((patflags != PatternSpec::NO_FLAGS) &&
     (owner->auto_scale == true) && (cbar != NULL))
    cbar->SetMinMax(-1,1);
  UpdateDisplay();
}
------------
After compiling the modified source distribution the Flags are now set 
in the correct way. It seems so :-).
Please note that I really don't know wether this was the right way nor 
this was a bug in pdp++ at all. 
I need to get feedback on this.
-- 
Mathias Weigt