15.7 The Probability Environment and Cs

An environment can be specified where each event has multiple possible target patterns, each of which has an associated probability of occurring. Thus, when an event is presented to the network, one out of a set of possible target patterns is chosen according to their relative probabilities. These probabilistic distributions of target states can actually be learned in a stochastic constraint satisfaction network.

Probabilities can be associated with different patterns by creating ProbPattern objects instead of the usual Pattern ones. The prob pattern has a prob field, which contains its probability of occurrence.

However, in order for these probabilities to be used in the presentation of patterns, one needs to use a ProbEventSpec, which has special code that chooses which pattern to present based on its probability. Not all patterns in an event need to be probabilistic. Indeed, the usual setup is to have a deterministic input pattern, and then a set of possible outputs that follow from this one input. The determiniation of which patterns are probabilistic and which are deterministic is made by putting all of the mutually-exclusive probabilistic alternative patterns in a ProbPatternSpec_Group.

Thus, one needs to make a sub-group in the patterns group on the ProbEventSpec, and this sub-group has to be of type ProbPatternSpec_Group. Then, regular PatternSpec objects, one for each alternative target pattern, should be created in the sub group. Make sure to set the pattern_type field of these pattern specs to be ProbPattern, so that the patterns which are created in the event will have probabilities associated with them.

When events are actually created from a prob event spec, one needs to edit the patterns within the sub-group and assign each of them probabilities that sum to 1 for all the patterns in the group. Thus, the network will be certain of choosing one of them to present.