Adding stopping criterion is successive fitness values are within 1% of each other.

这个提交包含在:
Craig Warren
2015-12-23 12:17:26 +00:00
父节点 d2637cd6af
当前提交 60903c4c10

查看文件

@@ -243,6 +243,12 @@ def main():
if fitnessvalueshist[i - 1] > fitness['stop']:
break
# Stop optimisation if successive fitness values are within 1%
if i > 2:
fitnessvaluesclose = (np.abs(fitnessvalueshist[i - 2] - fitnessvalueshist[i - 1]) / fitnessvalueshist[i - 1]) * 100
if fitnessvaluesclose < 1:
break
# Save optimisation parameters history and fitness values history to file
opthistfile = inputfileparts[0] + '_hist'
np.savez(opthistfile, dict(optparamshist), fitnessvalueshist)