singnet / asmoses

Port of MOSES (https://github.com/opencog/moses) for the AtomSpace (https://github.com/opencog/atomspace)
Other
6 stars 5 forks source link

AS-MOSES port(part III) - Porting Metapopulation #76

Closed Bitseat closed 5 years ago

Bitseat commented 5 years ago

Overview

Metapopulation stores a pool of scored combo trees generated during the deme expansion and optimization step. Having the metapopulation represented in atomspace helps for PLN inference usage and run the pattern matcher on the population. Here the plan is porting the metapopulation code to support atomese without touching the algorithms in charge of storing references of the candidates.

How the current implementation works

1. One element from the metapopulation is selected as an exemplar using an exponential distribution of the score.
2. The exemplar is then decorated with knobs and optimized to create a new deme.
3. High-scoring members of the deme (instances) are then explicitly converted into trees, and folded back into the metapopulation, possibly displacing less promising demes.
4. Repeat from step 1.

Initial proposal on the porting

As of my understanding, the first step would be porting the functions like init, select_exemplar, merge_candidates, merge_demes etc to suport atomese and leave the implementation with "not implemented yet". The second step would be, as Nil suggested, having a dedicated C++ structure to store the atomese representation of the candidates. We can achieve this by iterating through scored_trees and correspond each tree to a certain handle and store the candidates in atomspace. A discussion on how we can introduce program memorization is much appreciated.

ngeiswei commented 5 years ago

That looks good @Bitseat, just I would probably not iterate through _scored_trees and instead iterate through an isomorphic container for handles (meaning with the same ordering as _scored_trees), called _scored_atomeses or something.