## toss-devel

 [Toss-devel] Quantitative Toss From: Lukasz Kaiser - 2013-01-21 22:54:47 Attachments: condensation.pdf     cma-es-pso.pdf     mmsr.pdf     blog.pdf ```Hi. We were all thinking a lot recently about a more quantitative Toss, and I write this mail to sum up what was said so far and to open a thread for further thought and discussion. The problem starts with the fact that the world is not always discrete. We want to do vision, so we need various quantities. These can be probabilities, colors, movements and other things. Of course we support dynamics and quantities in Toss almost from the start. But it is neither efficient enough nor mature enough. Let's start with vision. Lukasz Stafiniak suggested to use an algorithm called Condensation, see e.g. the attached paper. This algorithm is based on a population of samples for which a stochastic model of dynamics is known. One uses the model to choose where to look and resample - speaking very crudely. This way the condensation works - on a very high level - looks to me to be quite similar to the cma-es algorithm for minimizing functions - the one I want to use for selection of continuous moves. A good paper that also describes the difference to particle swarm optimization is attached, but the key point is again the same: we have a number of samples, this time all gaussian, which move to minimize the function. Ok - no dynamics model or adjusting to what is observed here - but the same idea: a numer of samples used to represent a distribution that all together give a nice model. Now - to track the dynamics in condensation one needs to have some model of dynamics already. If we don't have it but want to create one, we could use some methods from another paper Lukasz Stafiniak recently linked. They show how a multi-modal symbolic regression (MMRS, attached as well) can be used to derive a model from the training data. We would need to track and derive at the same time, but, except for the added computational cost which might be big, this seems to be doable - at least in principle. But MMRS internally again uses evolutional optimization methods, in some sense it is another layer on top, like a recursive call in a sense. This is another thing that made me think: maybe we need a probabilistic quantitative model of relational structures, and then we could build it all on top of this in a clear systematic way? About adding quantities: there is also an internal need in Toss for doing this in a better way. Let me just recall that we have already 12 cases in our main formula type, and another 9 in real_expr. At some point each of those things was needed, but it starts to be hard to use - and I cannot tell why And and Or are built over a list but Plus and Times are only binary. And we still lack min, max, sin, cos - some things that will be needed for dynamics. So we will need to rework this part, and I think we should first think and discuss and maybe we'll find a better universal model for all this stuff. One thing I see now, is that we could assume *every* relation in the structure to be quantitative, always. It is easy to include true and false, e.g. as true = +infty, false = -infty. Then and/or will be max/min, and real-valued functions will not be needed in the structure type any more - they'll be simply predicates. This also unifies formula and real_expr to one type and I think that it would directly make quite a few things easier in our code. But I don't want to make a small restructuring only - let's try to think a bit deeper and find the right model, for both quantities like colors or positions, Boolean values, and probabilities too. One thing to watch in this context is Stuart Russell's lecture about probabilistic relational structures. It will be streamed live from Paris, tomorrow 6pm Paris time, see here. http://colloquium.lip6.fr/ It is hard to tell what the lecture will be about exactly, but attached is a paper on BLOG, a probabilistic logic over relational structures developed by Russell. I suggest to read it before the lecture :). Best! Lukasz P.S. As to time planning - I think we will do a release quite soon, before we move to implement any ideas discussed in this thread. ```