The 1958 perceptron paper predicts how well a randomly wired perceptron chooses between two responses after stimuli have been associated to each of them. One equation covers every case the paper studies, with four constants that depend on the machine and on the stimuli. Implement the equation for two cases: random stimuli with arbitrary labels, and two classes of similar stimuli.
Implement predicted_accuracy(n_sr, p_a, n_e, omega=None, classes=None, generalization=False).
The equation. With the standard normal cumulative distribution function,
Inputs
n_sr: list of positive numbers, the values of (stimuli associated to each response) at which to evaluate the curve.p_a: , the proportion of A-units a stimulus activates.n_e: , the number of effective A-units in each source-set (at least 2).omega, classes: exactly one of them is given and selects the case below.generalization: False for the probability of a correct response to a stimulus seen during learning (). True for a new stimulus of the same class (): then and the other constants are unchanged.Case 1, omega given: random stimuli (the paper's "ideal environment"), alpha system, sum-discriminating responses. omega is the fraction of responses each A-unit is connected to.
Case 2, classes = (pc11, pc12, sj11, sj12): one class of similar stimuli per response, mean-discriminating responses, disjoint source-sets. is the expected overlap probability between two stimuli of the same class, between stimuli of different classes, and , are their standard deviations across A-units (not both zero).
Output: a tuple (curve, asymptote).
curve: list of floats, at each of n_sr.asymptote: the limit of as , which is .math.erf is available.