Nil's work log

From OpenCog
Jump to: navigation, search

Log entries

Log entires 2010



  • changed vertex order in representation building to follow the order set by reduct (easier to debug and a bit faster too)
  • implemented ignore ops for variables (to quickly ignore any input suspected useless)
  • removed the 127 input limitation in MOSES (now up to 32767 inputs are possible)
  • fixed a bug related to large knob dimensional space (some overflow due to using 32 bit int instead of 64bit)
  • optimized bottleneck in representation building (when dimension is large) due to actually counting the number of potential candidates at distance d, I've replaced the code by combinatorics formulas to speed it up (which simplifies the code too)
  • fixed a bug in Distributed MOSES, there was wrong sync between and reading the results of a process (would only show up for big problems)
  • fixed a bug in select_exemplar (would crash very rarely)
  • halts all sub-processes when the main one halts in Distributed MOSES
  • added multiplexer problem
  • added more info log in distributed MOSES



  • fixed bug in field_set, bit_iterator::operator+= was buggy! It would crash too big representation
  • fixed bug in contin_neighbor_sampling (missing case, would crash MOSES rarely)
  • cleaned logging code for reduct
  • Implemented super-reductor for boolean expression (suggested by Moshe Looks), benchmarks show that super-reducing the exemplar significantly decreases the number of evals to reach the solution (2 folds in most of my experiments)
  • added effort parameters in reduct (0-3, 0 for minimum effort, 3 for maximum effort)
  • upgraded moses-exec to take options: pop_size_ratio, reduct effort (for candidates and representation building)
  • upgraded MOSES to handle cases where representation building is empty (this can happen where reduct is too strong)
  • upgraded MOSES to handle cases where all metapop has been visited (by re-visiting them, not sure it is worthwhile...)
  • fixed bug in SA (the jumping distance was not set correctly)
  • added option in moses-exec to generate the log file name according to the options passed in argument (very handy for benchmarking)
  • completed Distributed MOSES
  • added option to merge only up to N candidates, it gives a significant speed increase when well used, for instance on 3-parity merging only the 5 best candidates would speed up 3x (that's because there are less candidates to reduce and compute their bscore)
  • added option to ignore bscore (that is dominated candidates are also merged in the metapopulation)
  • fixed several minor bugs (fixed table reading for DOS format, parameter transfer to instance of MOSES, etc)
  • fixed the major bug in metapopulation::insert, the problem was that the insert method would not insert candidate if there is already a candidate of same score and size, even if non-dominated!



  • added option cache and reduce all candidates (no significant speed up gain in my experiment)
  • added option to switch btw count and complexity based scorer in moses-exec
  • added cache for behavioral score in moses-exec (+20% speed up gain in my experiment, that is because bscore is computed twice during scoring and deme management)
  • discovered and fixed an important bug in field_set code, contin_knob.mean was not initialized properly
  • finished to replace all output messages by log. Error message that are not log should be output on cerr
  • added Occam's razor for boolean + implemented simpler Occam's razor
  • made moses-exec only use reduction rules related to useful operators (+5% overall speed up gain for polynomial regression)
  • added option to output complexity and bscore for each best candidate in moses-exec (will be useful for distributed MOSES)
  • fixed a few bugs and simplified the code of SA optimizer
  • fixed another important bug, the select_exemplar method would use the wrong Solomonoff distro, shorter get lower probability, fixing it seemed to bring a noticeable gain
  • reviewed and cleaned hillclimbing optimization algo
  • upgrading moses-exec to take the existing problems (even_parity, disjunction, etc) present in other moses-* executables in option of moses-exec and removed the now redundant executables
  • cleaned Joel Lehman's code (ANN) and fixed several bugs (mostly dangling pointers)
  • integrated ANN problem in moses-exec based on contin table or combo tree
  • replaced full reduct by the domain dependent reduction in representation building. Speed gain on even parity problem (evals = 10000, algo = hillclimbing): 15mn -> 23s
  • fixed representation building bug and improved prototype logging for boolean expression, now one can see exactly how the prototype looks like. Excerpt from the log: [2010-07-30 11:48:32:343] [DEBUG] Created prototype: and(or(and(or(not(#1) [nil #2 !#2]) not(#3)) and(or(#1 [nil #2 !#2]) #3) and([#2 nil !#2] [nil #1 !#1] [nil #3 !#3] [nil or](#3 #1) [nil or](#3 not(#1)))) [nil or](#3 #1) or([nil and](#2 #1) [nil and](#3 not(#1)) [nil and](#3 #2))) where [pos_1 .. pos_n] represents the various positions of a knob (default = pos_1).


  • added print functions for debugging the reduct engine, rules have default names and can be given names, and print debugging methods can print the trace of a reduction using these names
  • fixed a factorization bug in reduct
  • added "ignore_size_increase" meta_rule to possibly ignore reductions that increase the tree size
  • added "when" meta_rule to ignore the rule if a given condition is not met


  • hunted bugs related to lru_cache which does not behave correctly when the function raises an exception, should be fixed



  • coded a main moses executable (moses-exec) with a bunch options
  • made moses-exec return the n best non-dominated candidates (will be useful for distributed MOSES)
  • started converting output debug messages in logger messages
  • hacked representation building to ignore div, sin, log and exp optionally
  • added macro to switch btw abs_log<->log (based on Moshe's comment)
  • Merged Xiaohui GSoC 2009 project
  • Merged Joel Lehman GSoC 2009 project
  • fixed a bug in integer_log2 (problem with 64bit arch)
  • cleaned MOSES' code, added comments
  • completed full contin support in MOSES (population sampling)
  • lots of MOSES' code refactoring
  • added score calculated based on behavioral score
  • fixed information_theoretic_bits to work with contin


  • added distribute reduction rule
  • added more UTest to test it
  • added the possibility to have log(x) defined as log(abs(x)) (can be enabled by the ABS_LOG define)

Till May

  • Added pretty print container functions in opencog/util/printContainer.h
  • Cleaned PLN code
  • Compiled CogBuntu 10.04 rc2

Log entries 2009

December (part time)

  • Compiled CogBuntu 9.10 rc1, rc2, rc3
  • Upgraded Cogbuntu building process to be 100% automatic and with no security problem
  • Fixed ImplicationBreakdown formula
  • Fixed StrictImplicationBreakdown rule (now conclusion can be a node)
  • Massive PLN code cleaning (see bzr log for more info)

November (part time)

  • Improved CogBuntu script maker
  • Various PLN code cleaning
  • fixed SubsetEvalRule and SubsetEvalRule test unit
  • Completed IntensionalInheritance Rule
  • Wrapped PLN rules to be called in scheme

August (part time)

  • Added macro OC_ASSERT (to be used instead of opencog::cassert)
  • Various comments and fixes in PLN code
  • Enabled SubsetEval formula + rule, and wrote test unit for it
  • fixed lazy_selector again and added method to reset its range dynamically

July (part time)

  • completed OpenCogBuntu
  • added option PASS_OPC_ARG_DEBUGGER_COMMAND in embodiment.conf to add the command line arguments in the command line when calling a debugger
  • Cleaned up PLN code a bit, like renaming formula attribute to be more explicit, replaced min, max, abs MACROs by STL version.
  • Fixed ramdom_selector
  • Enabled


2009/06/22 to 07/03

  • Attended AGI summer school in Xiamen




  • added interactive-reductor to reduce a combo tree step by step and choosing the rule interactively
  • more reformatting in comboreduct to meet OpenCog standard
  • added some comments in MOSES
  • Prepared Lectures for [AGI Summer School in Xiamen]


  • fixed bug in ActionFilter
  • added option ACTION_FILTER_ONLY_MIN_MAX to tell the action filter to return only action sub-sequence of size 1 or max (determined by ACTION_FILTER_SEQ_MAX)
  • Prepared Lectures for [AGI Summer School in Xiamen]


  • prepared ComboReduct and MOSES tutorial videos
  • prepared Embodiment tutorial videos
  • fixed wiki pages about LearningServer
  • studied MOSES code


  • fixed edaopt.h and update moses test executable accordingly
  • reformatted more MOSES code according to OpenCog standard
  • fixed and added (Alesis' patch)
  • studied MOSES code



  • fixed (extended beyond 2GB limit + added missing "NONE" in levelStrings[])
  • added command line parameters to opcHcTester to control learning time
  • reformatted MOSES code according to OpenCog standard
  • studied MOSES code


  • Studied PLN rule code
  • Fixed constitutedSet and wrote UTest
  • added TableGather UTest




Factorize sliced vs non-sliced optimization

There are redundancies in the expand code, moses and sliced optimization (hillclimbing), we should come up with a single API and code that deals cleanly with sliced optimization and factorize moses and expand code accordingly.

Combo Reduct

Place Holder Type Checker

The type checker should probably ignore arguments that do not correspond to place holders, like in

Simplify action_X operators



and add instead id::has_succeeded operator

EDIT: this probably a bad idea because then if one finds a boolean operator, which is purely functional, it cannot be sure it contains only purely functional arguments.

Simplify reduction rules by relying on properties instead of operator

Generalize reduct so that it exploit properties instead of specific operators.

for instance, x+0->x, and x*1->x could be the same reduction rule which would exploit the knowledge that 0 is the neutral element of + and 1 the neutral element of *.

Create an engine that infers the set of properties of a procedure based on its content

Would be useful for PLEASURE


Remove the pattern matcher code based on atom_tree and replace it by Linas's pattern matcher code on opencog/query

Reshaping the fitness estimator based on rewards

See ReshapingFitnessEstimatorBasedRewards_(Embodiment) for a description of the task

Bric a brac

Various speculations and ideas...

Reduction based on fitness properties

If we can reduce candidate to equivalent ones based on properties, maybe we can, given a fitness function and its properties, reduce non-equivalent candidates to score-equivalent ones, or even behavioral-score-equivalent ones based on these properties too.

A first attempt toward that idea is in the following thread:

Another advantage of representing the fitness function + candidate as Combo is that once can consider knobs as some sort of variables and perform reduction on the template (the exemplar + knobs generating the neighborhood) to get something simpler were constant parts of the program are not re-evaluated over and over, it reminds me a super compiler.