opencog / opencog

A framework for integrated Artificial Intelligence & Artificial General Intelligence (AGI)
http://wiki.opencog.org/w/Development
Other
2.34k stars 724 forks source link

confidenceToCount #588

Closed cosmoharrigan closed 6 years ago

cosmoharrigan commented 10 years ago

The maximum value that SimpleTruthValue::confidenceToCount will return is 4473923584: https://github.com/opencog/opencog/blob/master/opencog/atomspace/SimpleTruthValue.cc#L110

but SimpleTruthValue stores count as a double: https://github.com/opencog/opencog/blob/master/opencog/atomspace/SimpleTruthValue.h#L50 https://github.com/opencog/opencog/blob/186f25f8731e6fd912ceb915057d83997c3d3c8e/opencog/atomspace/TruthValue.h#L53 which can have a very large value.

this seems confusing, because if you tried to convert back and forth between them, you would lose information; for example, if the count were very large, and you used countToConfidence and then confidenceToCount, the number would reduce dramatically.

How should this actually be implemented?

linas commented 10 years ago

As implemented, the values stored there are good only to about 24 bits, and the rest is all round-off error.

You can try changing everything to double, I don't care. The use of float is historical, and had something to do with running out of RAM.

linas commented 10 years ago

well .. less than 24 bits. a 32-bit float uses a 22-bit mantissa and an 8-bit exponent, and two sign bits. The confidenceToCount etc functions are written so that if you use them over and over, precision decays to about 12 bits accuracy pretty quick.

linas commented 6 years ago

closing, stale bug report