addSoftClampGroup <in-group> <out-group> <num-units> [<init-val> <strength>] [-<link-type>] [-<group-type> ...]
This is a shortcut for building a soft-clamped input. A soft-clamped input in Lens actually consists of two groups. The first, the "in" group, is a standard input group with a SOFT_CLAMP transfer function. This is connected to another group, called the "out" group, using a ONE_TO_ONE projection with link weights frozen at 1.0. The out group can be of any type, although HIDDEN or OUTPUT are probably the only reasonable base types and it should have a sigmoid or integrated signoid transfer function. By default, there is no bias input to the out group.
The first two parameters give the names of the groups and the third is the number of units in each. If init-val and strength are specified, they will set the initValue and softClampStrength fields of the in group. These will affect its transfer function which is the following:
output = inverseSigmoid(initValue + strength * (input - initValue), gain);
The gain used here will be the gain of the out group's sigmoid function. The default initValue and softClampStrength are both 0.5. If link-type is specified, it gives the type of the links in the one-to-one projection from the in group to the out group. Otherwise, the type of this projection is the name of the in group. Finally, a list of group types can be specified which will apply to the out group.
The following command:
lens> addSoftClampGroup input input2 10 0.5 0.9 -soft -INTEGR_INPUT
is roughly equivalent to:
lens> addGroup input 10 -INPUT -SOFT_CLAMP lens> addGroup input2 10 -INTEGR_INPUT lens> disconnectGroups bias input2 lens> connectGroups input input2 -ONE_TO_ONE 1.0 -soft lens> freezeGroup input2 -soft lens> setObject [groupLongName input].initValue 0.5 lens> setObject [groupLongName input].softClampStrength 0.9
except that the output group's gain will not be used unless addSoftClampGroup is called.