Updates adjustment formula to a satisfactory formula

Out of all of the formulas I've tried, I believe this formula to be a more elegant alternative to Mitchell's formula.
However, like Mitchell's original formula, it still provides weird answers in some cases, but I believe these to source from elsewhere,
not from the adjustment formula.

For more information, please see:

https://docs.google.com/spreadsheets/d/1JT2yCBUAsFzMcbKsQUcH1DhcBbuWDKTgPvUwD9EqyTY/edit?usp=sharing
wq
This commit is contained in:
lsaldyt
2017-10-16 13:21:19 -07:00
parent 6985dedb18
commit 765323c3cd
2 changed files with 10 additions and 2 deletions

View File

@ -68,7 +68,7 @@ class Copycat(object):
def run(self, initial, modified, target, iterations):
self.workspace.resetWithStrings(initial, modified, target)
self.temperature.useAdj('original')
#self.temperature.useAdj('original')
#self.temperature.useAdj('entropy')
#self.temperature.useAdj('inverse') # 100 weight
#self.temperature.useAdj('fifty_converge')
@ -76,6 +76,7 @@ class Copycat(object):
#self.temperature.useAdj('weighted_soft')
#self.temperature.useAdj('alt_fifty')
#self.temperature.useAdj('average_alt')
self.temperature.useAdj('best')
answers = {}
for i in range(iterations):

View File

@ -56,6 +56,12 @@ def _averaged_alt(temp, prob):
u = prob ** 2 if prob < .5 else math.sqrt(prob)
return _weighted(temp, prob, s, u)
def _working_best(temp, prob):
s = .5 # convergence
r = 1.05 # power
u = prob ** r if prob < .5 else prob ** (1/r)
return _weighted(temp, prob, s, u)
class Temperature(object):
def __init__(self):
self.reset()
@ -68,7 +74,8 @@ class Temperature(object):
'soft' : _soft_curve,
'weighted_soft' : _weighted_soft_curve,
'alt_fifty' : _alt_fifty,
'average_alt' : _averaged_alt}
'average_alt' : _averaged_alt,
'best' : _working_best}
def reset(self):
self.actual_value = 100.0