Noisy-MAX

<< Click to Display Table of Contents >>

Navigation:  Using SMILE Wrappers > Canonical nodes >

Noisy-MAX

Noisy-MAX is a generalization of the popular canonical gate Noisy-OR and is capable of modeling interactions among variables with multiple states. If all the nodes in question are binary, a Noisy-MAX node reduces to a Noisy-OR node. The Noisy-MAX, as implemented in SMILE, includes an equivalent of negation. By DeMorgan's laws, the OR function (or its generalization, the MAX function) along with a negation, is capable of expressing any logical relationship, including the AND (and its generalization, MIN). This means that SMILE's Noisy-MAX can be used to model the Noisy-AND/MIN functions, as well as other logical relationships.

SMILE's inference algorithm contains special code path for networks with Noisy-MAX nodes, which can speed up computations significantly. See the Inference section of this manual for details.

To create a Noisy-MAX node, use the NOISY_MAX type with Network.addNode:

Java:

net.addNode(Network.NodeType.NOISY_MAX, "node1"); 

Python:

net.add_node(pysmile.NodeType.NOISY_MAX, "node1")

R:

net$addNode(net$NodeType$NOISY_MAX, "node1")

C#:

net.AddNode(Network.NodeType.NoisyMax, "node1"); 

Noisy-MAX node has discrete outcomes (just like CPT nodes). Noisy-MAX specific attributes are:

an array of conditionally independent (CI) probabilities, which can be set and retrieved by Network.setNodeDefinition and getNodeDefinition.

for each of node's parents, an array of parent outcome strengths. Parent outcome strengths enable control of the order of states of the parent nodes, as they enter their relation with the child. A Noisy-MAX CI table always follows the order of strengths. Use Network.setNoisyParentStrengths and getNoisyParentStrengths to modify or read the parent strengths.

As an example, consider a binary Noisy-MAX node with two parents, each with three outcomes. The following snippet modifies the probabilities and outcome strengths for the second parent (with zero-based index 1).

Java:

double[] ci = net.getNodeDefiniton(h);

int BASE = 2 * 3; 

ci[BASE]     = 0.1;

ci[BASE + 1] = 0.9;

ci[BASE + 2] = 0.3;

ci[BASE + 3] = 0.7;

net.setNodeDefiniton(h, ci);

net.setNoisyParentStrengths(h, 1, new int[] { 2, 0, 1 });

Python:

ci = net.get_node_definition(h)

BASE = 2 * 3

ci[BASE]     = 0.1

ci[BASE + 1] = 0.9

ci[BASE + 2] = 0.3

ci[BASE + 3] = 0.7

net.set_node_definition(h, ci)

net.set_noisy_parent_strengths(h, 1, [2, 0, 1])

R:

ci <- net$getNodeDefiniton(h)

BASE <- 2 * 3

ci[BASE + 1] <- 0.1

ci[BASE + 2] <- 0.9

ci[BASE + 3] <- 0.3

ci[BASE + 4] <- 0.7

net$setNodeDefiniton(h, ci)

net$setNoisyParentStrengths(h, 1, c(2L, 0L, 1L))

C#:

double[] ci = net.GetNodeDefinition(h);
int BASE = 2 * 3; 

ci[BASE]     = 0.1;

ci[BASE + 1] = 0.9;

ci[BASE + 2] = 0.3;

ci[BASE + 3] = 0.7;

net.SetNoisyParentStrengths(h, 1, new int[] { 2, 0, 1 });

The value of BASE is calculated as a product of node outcome count and preceding parents' outcome counts (in this case, there is just one preceding parent with three outcomes). The probabilities for the parent are written into an array returned by Network.getNodeDefiniton and used in a setNodeDefinition call, because we just want to modify one parents' probabilities and leave other CI probabilities unchanged. The next step changes the order of parents' outcomes in relationship to the Noisy-MAX node with Network.setParentOutcomeStrengths call, the first column of probabilities for parent with index 1 (the one with 0.1 and 0.9) represents the probabilities for the parent outcome with index 2 (because 2 is the first element in the strengths array). Note that this does not modify the parent node in any way and the ordering is valid only in the context of this particular parent-child relationship. Assuming that we started with the default uniform probabilities in the table, our modifications yields the following Noisy-Max definition, as viewed in GeNIe:

noisyMAX

The outcomes of both parent are {State0, State1, State2}. However, by using setParentOutcomeStrenghts for parent p2, its outcomes are seen by the Noisy-MAX child node as {State2, State0, State1}. Other Noisy-MAX nodes in the same network can set up their own parent outcome ordering if p2 becomes their parent.