boris-kz / CogAlg

This project is a Computer Vision implementation of general hierarchical pattern discovery principles introduced in README
http://www.cognitivealgorithm.info
MIT License
91 stars 41 forks source link

Scan_P debug #10

Closed Twenkid closed 4 years ago

Twenkid commented 6 years ago

The older thread got too long.

What's the current specific bug?

Sorry these day I've been a bit distracted, a bit busy to collect big enough chunk of focus to say something meaningful. Regarding CogAlg I was thinking about how exactly to bite the problem of trackingl, either to start manually or immediately to approach automation which includes code analysis and would be ore general and easier for application for the other modules. I may start manual for some variables and thrn move to semi- automatic with an editor. I was also checking Python stuff.

That approach with locals() and exec could work persistently only in Python2, in 3 they don't allow write-access to the system dictionary of local vars outside of the official program flow, perhaps for security reasons and due to changes in the implementation of exec, which has turned from a special statement to a function. Another explicit dictionary of the local variables has to be used, like with the approach of sending arguments as a dictionary, or the vars to be set explicitly in normal code, if I use something like that I'd generate it.

I know you don't need that now, but I opened that topic and needed to clarify this.

https://github.com/boris-kz/CogAlg/blob/dbcbf3413363bb52600cb0dc3a364abd858a230a/frame_dblobs.py#L129

boris-kz commented 6 years ago

It doesn't matter if len(ders2_) is 0 or not.

On Sun, Sep 30, 2018 at 4:40 PM Todor Arnaudov notifications@github.com wrote:

You mean this old code:

def form_seg(P, seg, last_x): # continued or initialized blob segment is incremented by attached P s, I, D, Dy, V, Vy, ders2 = P # s is identical, ders2 is a replacement (s, Ls, Is, Ds, Dys, Vs, Vys), Py, x, xD, root, fork = seg # fork_ assigned at ini only, roots at form_blob?

x = last_x - len(ders2_) // 2
xd = x - _x  # conditional full comp(x) and comp(S): internal vars are secondary?
xD += xd  # for segment normalization and orientation eval, | += |xd| for curved max_L norm, orient?
Ls += len(ders2_)  # ders2_ in P buffered in Py_

That now sounds as the Alg has once expected that ders2_ was > 0 (1), but it was 0, so Ls+=0 hasn't modified anything.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/boris-kz/CogAlg/issues/10#issuecomment-425750325, or mute the thread https://github.com/notifications/unsubscribe-auth/AUAXGQLWsaQcPdYxTndluhi2RdEf8AEsks5ugSwxgaJpZM4W0XYx .

Twenkid commented 6 years ago

OK, I don't know how len(ders2) would return len(ders2)-1... Are you sure you've checked the values correctly.

Only if it was compared to something else.

boris-kz commented 6 years ago

Check it. I don't need philosophy.

On Sun, Sep 30, 2018 at 5:00 PM Todor Arnaudov notifications@github.com wrote:

OK, I don't know how len(ders2) would return len(ders2)-1... Are you sure you've checked the values correctly.

Only if it was compared to something else.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/boris-kz/CogAlg/issues/10#issuecomment-425751668, or mute the thread https://github.com/notifications/unsubscribe-auth/AUAXGboi7MjbA6NAPjzgrmnHFMYwQDaHks5ugTDYgaJpZM4W0XYx .

Twenkid commented 6 years ago

I won't give you philosophy, I say your claim makes no sense to me at the moment, I don't know what to check.

L = len(ders2_), this should not return len(ders2_) - 1

Yes, it shouldn't, either you think the value of ders2_ was different than it was or you've seen not the values at the right moment, but a cycle earlier or you subtract one somewhere - perhaps in a hidden part of code which is invisible.

boris-kz commented 6 years ago

Check P vars in P_ or P, in pycharm.

On Sun, Sep 30, 2018 at 5:07 PM Todor Arnaudov notifications@github.com wrote:

I won't give you philosophy, I say your claim makes no sense to me at the moment, I don't know what to check.

L = len(ders2), this should not return len(ders2) - 1

Yes, it shouldn't, either you think the value of ders2_ was different than it was or you've seen not the values at the right moment, but a cycle earlier or you subtract one somewhere - perhaps in a hidden part of code which is invisible.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/boris-kz/CogAlg/issues/10#issuecomment-425752175, or mute the thread https://github.com/notifications/unsubscribe-auth/AUAXGQVlP5quo1X81HH1HEiq7iaLTL9qks5ugTKagaJpZM4W0XYx .

boris-kz commented 6 years ago

Ok I replaced L = len(ders2_) with L += 1, last update. That fixed this specific problem, but I still don't know why it happened.

On Sun, Sep 30, 2018 at 5:17 PM Boris Kazachenko boris.kz@gmail.com wrote:

Check P vars in P_ or P, in pycharm.

On Sun, Sep 30, 2018 at 5:07 PM Todor Arnaudov notifications@github.com wrote:

I won't give you philosophy, I say your claim makes no sense to me at the moment, I don't know what to check.

L = len(ders2), this should not return len(ders2) - 1

Yes, it shouldn't, either you think the value of ders2_ was different than it was or you've seen not the values at the right moment, but a cycle earlier or you subtract one somewhere - perhaps in a hidden part of code which is invisible.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/boris-kz/CogAlg/issues/10#issuecomment-425752175, or mute the thread https://github.com/notifications/unsubscribe-auth/AUAXGQVlP5quo1X81HH1HEiq7iaLTL9qks5ugTKagaJpZM4W0XYx .