The first method which Iused to is static mixing. Now, Im trying to move true neural network (hidden layer, error momentum etc). Current draft version is like that:Originally Posted by toffer
<div class=""jscript""><pre>BitModel order0[256];
BitModel order1[256][256];
BitModel order2[256][256][256];
NeuralMixer mixers[256][256][256];
...
// encoding
p0 = order0[ord0].GetProb();
p1 = order1[ord1][ord0].GetProb();
p2 = order2[ord2][ord1][ord0].GetProb();
p = mixer[ord2][ord1][ord0].Mix(p0, p1, p2);
Encode(bit, p);
order0[ord0].Update(bit);
order1[ord1][ord0].Update(bit);
order2[ord2][ord1][ord0].Update(bit);
mixer[ord2][ord1][ord0].Update();
...
// mixing
p = ((p0 * w0) + (p1 * w1) + (p2 * w2)) / weightSum;
...
// weight updating
int target = max(p0, max(p1, p2));
if (p0 == target)
w0 += (((UInt16)(~w0)) >> 5);
else
w0 -= ((w0) >> 5);
if (p1 == target)
w1 += (((UInt16)(~w1)) >> 5);
else
w1 -= ((w1) >> 5);
if (p2 == target)
w2 += (((UInt16)(~w2)) >> 5);
else
w2 -= ((w2) >> 5);
weightSum = w0 + w1 + w2;
</pre></div>
As you see, this isnt a precise solution. But, its better than use simple order-n model. Old weight updating solution was:
<div class=""jscript""><pre>if (p0==target)
w0++;
else
w1>>1;
...</pre></div>
As you see, this one works like semi-stationary update. But, IIRC first code has better compression. I forget why I choose the first code. I have to get some B12 vitamin tablets![]()




