start work om distributed decision making
This commit is contained in:
@ -1,9 +1,7 @@
|
|||||||
co.py.cat
|
co.py.cat
|
||||||
=========
|
=========
|
||||||
|
|
||||||
**Dear potential co-authors,**
|
I am planning to use this codebase, or Joseph A. Hager's, to implement a variation of Copycat that uses *Entropy* instead of *Temperature*, while still preserving the parallel terraced scan in full form. If the change is viable, I plan to write a paper on that (if anyone is interested in co-authoring, let me know). For the general idea, please see pages 41 and 42 of the [*Information Sciences*](https://github.com/Alex-Linhares/FARGlexandria/blob/master/Literature/Chess-Capyblanca-2014-Linhares-Information%20Sciences.pdf) paper on [Capyblanca](https://github.com/Alex-Linhares/FARGlexandria).
|
||||||
|
|
||||||
I am planning to use this codebase, or Joseph A. Hager's, to implement a variation of Copycat that uses Entropy instead of Temperature and still preserves the parallel terraced scan in full form. If the change is viable, I plan to write a paper on that. For the general idea, please see pages 41 and 42 of the [*Information Sciences*](https://github.com/Alex-Linhares/FARGlexandria/blob/master/Literature/Chess-Capyblanca-2014-Linhares-Information%20Sciences.pdf) paper on [Capyblanca](https://github.com/Alex-Linhares/FARGlexandria).
|
|
||||||
|
|
||||||
**If you would like to help research and publish a paper, please let me know.**
|
**If you would like to help research and publish a paper, please let me know.**
|
||||||
|
|
||||||
|
|||||||
304866
copycat.log
304866
copycat.log
File diff suppressed because it is too large
Load Diff
@ -1010,7 +1010,7 @@ def correspondence_strength_tester(ctx, codelet):
|
|||||||
objectFromTarget.flipped_version())))
|
objectFromTarget.flipped_version())))
|
||||||
correspondence.updateStrength()
|
correspondence.updateStrength()
|
||||||
strength = correspondence.totalStrength
|
strength = correspondence.totalStrength
|
||||||
#TODO: use entropy
|
# TODO: use entropy
|
||||||
probability = temperature.getAdjustedProbability(strength / 100.0)
|
probability = temperature.getAdjustedProbability(strength / 100.0)
|
||||||
if random.coinFlip(probability):
|
if random.coinFlip(probability):
|
||||||
# activate some concepts
|
# activate some concepts
|
||||||
@ -1064,8 +1064,8 @@ def correspondence_builder(ctx, codelet):
|
|||||||
# if there is an incompatible bond then fight against it
|
# if there is an incompatible bond then fight against it
|
||||||
initial = correspondence.objectFromInitial
|
initial = correspondence.objectFromInitial
|
||||||
target = correspondence.objectFromTarget
|
target = correspondence.objectFromTarget
|
||||||
if (initial.leftmost or initial.rightmost and
|
if (initial.leftmost or initial.rightmost and
|
||||||
target.leftmost or target.rightmost):
|
target.leftmost or target.rightmost):
|
||||||
# search for the incompatible bond
|
# search for the incompatible bond
|
||||||
incompatibleBond = correspondence.getIncompatibleBond()
|
incompatibleBond = correspondence.getIncompatibleBond()
|
||||||
if incompatibleBond:
|
if incompatibleBond:
|
||||||
|
|||||||
@ -27,11 +27,11 @@ def lower_bound_on_probability(hits, attempts, confidence=0.95):
|
|||||||
if attempts == 0:
|
if attempts == 0:
|
||||||
return 0
|
return 0
|
||||||
z = pnormaldist(confidence)
|
z = pnormaldist(confidence)
|
||||||
zsqr = z*z
|
zsqr = z * z
|
||||||
phat = 1.0 * hits / attempts
|
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)
|
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):
|
def upper_bound_on_probability(hits, attempts, confidence=0.95):
|
||||||
|
|||||||
3
main.py
3
main.py
@ -4,12 +4,14 @@ import logging
|
|||||||
|
|
||||||
from copycat import Copycat, Reporter
|
from copycat import Copycat, Reporter
|
||||||
|
|
||||||
|
|
||||||
class SimpleReporter(Reporter):
|
class SimpleReporter(Reporter):
|
||||||
def report_answer(self, answer):
|
def report_answer(self, answer):
|
||||||
print('Answered %s (time %d, final temperature %.1f)' % (
|
print('Answered %s (time %d, final temperature %.1f)' % (
|
||||||
answer['answer'], answer['time'], answer['temp'],
|
answer['answer'], answer['time'], answer['temp'],
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
logging.basicConfig(level=logging.INFO, format='%(message)s', filename='./copycat.log', filemode='w')
|
logging.basicConfig(level=logging.INFO, format='%(message)s', filename='./copycat.log', filemode='w')
|
||||||
|
|
||||||
@ -27,5 +29,6 @@ def main():
|
|||||||
for answer, d in sorted(iter(answers.items()), key=lambda kv: kv[1]['avgtemp']):
|
for answer, d in sorted(iter(answers.items()), key=lambda kv: kv[1]['avgtemp']):
|
||||||
print('%s: %d (avg time %.1f, avg temp %.1f)' % (answer, d['count'], d['avgtime'], d['avgtemp']))
|
print('%s: %d (avg time %.1f, avg temp %.1f)' % (answer, d['count'], d['avgtime'], d['avgtemp']))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
|||||||
Reference in New Issue
Block a user