factor-graph icon indicating copy to clipboard operation
factor-graph copied to clipboard

dynamic networks support

Open psycharo-zz opened this issue 12 years ago • 1 comments

Currently one has to manually propagate messages from step to step for a dynamic network. Maybe extending Network with something that allows to specify connections between different (time)steps could work.

psycharo-zz avatar Dec 07 '12 20:12 psycharo-zz

I left a comment in the code relating to commit #cc429e0 but I'm not sure if you received that. Any the comment is this:

Just FYI (and please change code accordingly), look at the time elapsed (40X faster) for the following two pieces of code that implement the same:

>> clear results
>>  tic
    results = struct('id', {}, 'message', {});
    for i = 1:1000
        results = [results struct('id', y.id, 'message', ffg.gaussMessage(i+randn()*sd, 0, 'VARIANCE'))];
    end
    toc
Elapsed time is 0.387352 seconds.
>> clear results
>> tic
    for i = 1000:-1:1
        results(i) = struct('id', y.id, 'message', ffg.gaussMessage(i+randn()*sd, 0, 'VARIANCE'));
    end
    toc
Elapsed time is 0.099072 seconds.

In matlab, it helps to pre-allocate memory by first initializing the array entry with highest index.

ghost avatar Dec 12 '12 21:12 ghost