start work om distributed decision making
This commit is contained in:
@ -1010,7 +1010,7 @@ def correspondence_strength_tester(ctx, codelet):
|
||||
objectFromTarget.flipped_version())))
|
||||
correspondence.updateStrength()
|
||||
strength = correspondence.totalStrength
|
||||
#TODO: use entropy
|
||||
# TODO: use entropy
|
||||
probability = temperature.getAdjustedProbability(strength / 100.0)
|
||||
if random.coinFlip(probability):
|
||||
# activate some concepts
|
||||
@ -1064,8 +1064,8 @@ def correspondence_builder(ctx, codelet):
|
||||
# if there is an incompatible bond then fight against it
|
||||
initial = correspondence.objectFromInitial
|
||||
target = correspondence.objectFromTarget
|
||||
if (initial.leftmost or initial.rightmost and
|
||||
target.leftmost or target.rightmost):
|
||||
if (initial.leftmost or initial.rightmost and
|
||||
target.leftmost or target.rightmost):
|
||||
# search for the incompatible bond
|
||||
incompatibleBond = correspondence.getIncompatibleBond()
|
||||
if incompatibleBond:
|
||||
|
||||
@ -27,11 +27,11 @@ def lower_bound_on_probability(hits, attempts, confidence=0.95):
|
||||
if attempts == 0:
|
||||
return 0
|
||||
z = pnormaldist(confidence)
|
||||
zsqr = z*z
|
||||
zsqr = z * z
|
||||
phat = 1.0 * hits / attempts
|
||||
under_sqrt = (phat * (1 - phat) + zsqr / (4*attempts)) / attempts
|
||||
under_sqrt = (phat * (1 - phat) + zsqr / (4 * attempts)) / attempts
|
||||
denominator = (1 + zsqr / attempts)
|
||||
return (phat + zsqr / (2*attempts) - z * (under_sqrt ** 0.5)) / denominator
|
||||
return (phat + zsqr / (2 * attempts) - z * (under_sqrt ** 0.5)) / denominator
|
||||
|
||||
|
||||
def upper_bound_on_probability(hits, attempts, confidence=0.95):
|
||||
|
||||
Reference in New Issue
Block a user