[pdp-discuss] Leabra: learning continous values over time?

Randall C. O'Reilly Randy.OReilly at colorado.edu
Sat Mar 3 08:41:04 MST 2007


void ScalarValLayerSpec::ClampValue(Unit_Group* ugp, LeabraTrial*, float 
rescale) {
  if(ugp->size < 3) return;	// must be at least a few units..
  LeabraUnit* u = (LeabraUnit*)ugp->FastEl(0);
  LeabraUnitSpec* us = (LeabraUnitSpec*)u->spec.spec;
  u->SetExtFlag(Unit::EXT);
>>>>  float val = val_range.Clip(u->ext);		// first unit has the value to 
clamp
  scalar.InitVal(val, ugp->size, unit_range.min, unit_range.range);
  int i;
  for(i=1;i<ugp->size;i++) {
    LeabraUnit* u = (LeabraUnit*)ugp->FastEl(i);
    float act = rescale * scalar.GetUnitAct(i);
    if(act < us->opt_thresh.send)
      act = 0.0f;
    u->SetExtFlag(Unit::EXT);
    u->ext = act;
  }
}

This is the key line of code (line 4784 in my leabra.cc file):
  float val = val_range.Clip(u->ext);		// first unit has the value to clamp

Change to:
  float val = u->ext;

clip keeps it in range.

- Randy

On Saturday 03 March 2007 08:17, Frank Leoné wrote:
> Hi all,
>
> I looked at the code and I understand what's happening, but I can't find
> where the boundaries are checked. The entire calculation seems to already
> assume the value is between the boundaries, though also in the unitspec no
> such check is made. Also if I look at the EXT-input of the first unit of
> the layer (in the Network-view), it is unbounded, so the limits are not
> unit-dependent, but vallayerspec dependent. Still I can't seem to find
> where it happens...
>
> Can someone help me? I really need this to work,
>
> thanks a lot in advance!
>
> Frank
>
> _________________________________________________________________
> Live Search, for accurate results! http://www.live.nl
>
> _______________________________________________
> PDP-Discuss mailing list
> PDP-Discuss at psych.Colorado.EDU
> http://psych.colorado.edu/mailman/listinfo/pdp-discuss


More information about the PDP-Discuss mailing list