moses improvement update 08/11

0 views
Skip to first unread message

Xiaohui Liu

unread,
Aug 11, 2009, 5:36:53 AM8/11/09
to openc...@googlegroups.com, opencog-d...@googlegroups.com, Nil Geisweiller
Hi all,

The SA implemented last week have many bugs and bad performance. I have rewritten the SA implementation for sample one neighborhood every time according to the suggestion of Nil. And it should be work now, but many more tests need to be done. It should also need to be modified it to sample many neighborhood at one time, which will improve the performance.

The contin type is added e to the sample_from_neighborhood. I have added a function called generate_contin_neighborhood to generate one neighborhood one time of the contin instance by the given distance(now ,the distance is equals to 1). I have write the unit test for this function. But it still has a bug,which blocks me at these days. I am trying to fix it as soon as possible.

I have push the code to the branch :
 https://launchpad.net/~xiaohui/opencog/moses
and update the wiki

Thanks,
Xiaohui

Xiaohui Liu

unread,
Aug 11, 2009, 7:13:08 AM8/11/09
to Nil Geisweiller, openc...@googlegroups.com, opencog-d...@googlegroups.com


On Tue, Aug 11, 2009 at 6:18 PM, Nil Geisweiller <ngei...@googlemail.com> wrote:
Hi Xiaohui,


> The contin type is added e to the sample_from_neighborhood. I have added a function called generate_contin_neighborhood to generate one neighborhood one time of the contin instance by the given distance(now ,the distance is equals to 1).

great, I've started reading your code and noticed an error in the
comment of generate_contin_neighbor:

 * It generates the contin neighbor with the haming distance from
 * the given instance.For examples, if the contin[it.idx()] is encoded
 * with depth = 4,like (L R S S), so the neighbors with distance = 1 of it
 * are (R L S S), (L L S S),(L R L S) and (L R R S). And we randomly chose
 * one of them to return.

(R L S S) is not at distance 1 of (L R S S) but at distance 2, instead
it should be (L S S S) (that is probably a typo).
Oh, it is my fault. hmm, according to the currently implementation, the situation of (L S S S)
is not considered.Well, It should be added later. 

You will also need to update generate_all_in_neighborhood, eventually.

Also, I think you should remove completely the functions:

template<typename Out>
void sample_from_neighborhood(const eda::field_set& fs, int n,
                             int sample_size, Out out, opencog::RandGen& rng)

and

template<typename Out>
   void generate_all_in_neighborhood(const eda::field_set& fs, int n, Out out)

That are the versions without instance (center) in input, and update
moses so that it uses the ones taking an instance in input, because
now that contin is introduced, we cannot assume that a deme exemplar
has all its knobs set to 0.
 BTW, as the neighborhood sampling code start to be bigger I think it
would make sense to move it to another file, say
neighborhood_sampling.h

And finally, please rebase your code and use OC_ASSERT(...) instead of
opencog::cassert(TRACE_INFO, ...).

Thanks!
Nil

Reply all
Reply to author
Forward
0 new messages