ScalarValLayerSpec
From Emergent
Back to Leabra
The ScalarValLayerSpec encodes and decodes scalar, real-numbered values based on a coarse coded distributed representation (e.g., a Gaussian bump) across multiple units. This provides a very efficient and effective way of representing scalar values -- individual Leabra units do not do a very good job of that, as they have a strong binary bias.
Auto-generated Reference Docs: ScalarValLayerSpec
Contents |
Generally Good Parameters
The following are sets of parameters that have been tested and found to work well at learning a scalar value representation based on probabilistic binary inputs and continuous-valued inputs.
Gaussian Bump, 12 Units for 0-1 Value Rep
- Layer:
- 12 units, 1 = value and 11 are value-coding
- unit range is -0.5 to 1.5 (margin around target value range of 0-1)
- unit values are: -.5, -.3, -.1 .1 .3 .5 .7 .9 1.1 1.3 1.5
- LeabraLayerSpec: k = 3; KWTA_AVG_INHIB, pt = .6 --or-- KWTA_INHIB, pt = .25
- Std Unit Spec
- ConSpec: for probabilistic encoding, using wt_sig = 1, 1 instead of 6, 1.25 is key; also err_sb off is more fidelitous.
Gaussian Bump, 22 Units for 0-1 Value Rep
- Layer:
- 22 units, 1 = value and 21 value coding
- unit_range -0.5 to 1.5
- unit values are -.5 to 1.5 in .1 increments
- LeabraLayerSpec: k = 6; KWTA_AVG_INHIB, pt = .6 --or-- KWTA_INHIB, pt = .25
- Std Unit Spec
- ConSpec: for probabilistic encoding, using wt_sig = 1, 1 instead of 6, 1.25 is key; also err_sb off is more fidelitous.
Localist, 4 units for 0-1 Value Rep (used in PVLV)
- Layer:
- 4 units, 1 = value and 3 value coding
- unit_range = 0-1
- unit values are 0, .5, 1
- LeabraLayerSpec: k = 1, KWTA_AVG_INHIB, pt = .9
- UnitSpec:
- act.thr = .17, gain = 220, nvar = 0.01 (softer gain overall)
- act_fun = NOISY_LINEAR (linear response!)
Special Setup for ScalarValLayers
There are two things you need to do different from standard layers:
InputData (when the layer receives input)
- See InputData for general information about this
- The key thing is that ScalarVals only need the 1st unit to receive external input, where this input is the scalar value to be represented on the layer (unless the clamp_pat flag is selected, in which case you can clamp the whole pattern if you want).
- To achieve this, just change the geometry of your input data table column that goes to this layer: select the column, and do Column/Change Col Cell Geom menu action, and change to 1x1 geom with 2 dims (NOTE: do NOT make it a scalar -- the system that applies input to the network requires that this be at least a 2d matrix).
Monitoring layer values
- See Monitor Data for general info about this
- As with input data, the key issue is recording only from the 1st unit that encodes the scalar value
- As of 4.0.17, the monitor system allows you to use the following syntax for the variable to monitor on a layer: units[0].act_eq (note: must use eq and not plain act, which is always zero -- can also monitor act_m or act_p) -- this will grab the value from the first unit in the layer, which is what you want.
