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
90 stars 42 forks source link

distance_g ... instead of hypot_g? #28

Closed Twenkid closed 3 years ago

Twenkid commented 5 years ago

I am watching the updates in Khan's repository, intra_comp and I see you stick to the Python function name hypot, but IMO a more suggestive name for the CogAlg function is "distance", since we are not working with triangles and that concept is used in the introduction.

"Distance" (2D) or "Length" (for a vector) is also how that function is usually called in computer graphics libraries and shader languages, e.g. https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/distance.xhtml

Also "hypot" is only 2D, while distance is generalized for vectors, and I assume that's the goal in the long run, either per derivative and per patterns, and in "clustering": measurement of the distances between the patterns, where a part of the distance is their "pose" - allowed parameter variation within the same-pattern-space, without crossing a border to another pattern, given the selected partitioning of the space of patterns and poses.

def hypotg(P, dert_buff, dert):

boris-kz commented 5 years ago

We already have a more meaningful term for distance: gradient. Hypot_g is to distinguish it from initial gradient = |dx| + |dy|.

On Fri, Apr 12, 2019, 1:41 PM Todor Arnaudov notifications@github.com wrote:

The name of hypot_g

I am watching the updates in Khan's repository, intra_comp and I see you stick to the Python function name hypot, but IMO a more suggestive name for the CogAlg function is "distance", since we are not working with triangles and that concept is used in the introduction.

"Distance" (2D) or "Length" (for a vector) is also how that function is usually called in computer graphics libraries and shader languages, e.g. https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/distance.xhtml

Also "hypot" is also only 2D, while distance is generalized for vectors, and I assume that's the goal in the long run, either per derivative and per patterns, and in "clustering": measurement of the distances between the patterns, where a part of the distance is their "pose" - allowed parameter variation within the same-pattern-space, without crossing a border to another pattern, given the selected partitioning of the space of patterns and poses.

def hypotg(P, dert_buff, dert):

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/boris-kz/CogAlg/issues/28, or mute the thread https://github.com/notifications/unsubscribe-auth/AUAXGS4kgnnvFCBWdh-baWH61CmNss0zks5vgMUvgaJpZM4csmw9 .

Twenkid commented 5 years ago

It is different though, gradient suggests a derivative, a direction/tendency of change. Hypot or distance is not a derivative in that sense, no direction (unless you treat its difference to average etc. as a sign and direction for another calculation).

On Friday, April 12, 2019, Boris Kazachenko notifications@github.com wrote:

We already have a more meaningful term for distance: gradient. Hypot_g is to distinguish it from initial gradient = |dx| + |dy|.

On Fri, Apr 12, 2019, 1:41 PM Todor Arnaudov notifications@github.com wrote:

The name of hypot_g

I am watching the updates in Khan's repository, intra_comp and I see you stick to the Python function name hypot, but IMO a more suggestive name for the CogAlg function is "distance", since we are not working with triangles and that concept is used in the introduction.

"Distance" (2D) or "Length" (for a vector) is also how that function is usually called in computer graphics libraries and shader languages, e.g. https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/distance.xhtml

Also "hypot" is also only 2D, while distance is generalized for vectors, and I assume that's the goal in the long run, either per derivative and per patterns, and in "clustering": measurement of the distances between the patterns, where a part of the distance is their "pose" - allowed parameter variation within the same-pattern-space, without crossing a border to another pattern, given the selected partitioning of the space of patterns and poses.

def hypotg(P, dert_buff, dert):

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/boris-kz/CogAlg/issues/28, or mute the thread https://github.com/notifications/unsubscribe-auth/AUAXGS4kgnnvFCBWdh- baWH61CmNss0zks5vgMUvgaJpZM4csmw9 .

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

boris-kz commented 5 years ago

It is different though, gradient suggests a derivative, a direction/tendency of change.

That's exactly what we have. Hypot() is simply a way to compute it.

Hypot or distance is not a derivative in that sense, no direction (unless you treat its difference to average etc. as a sign and direction for another calculation).

On Friday, April 12, 2019, Boris Kazachenko notifications@github.com wrote:

We already have a more meaningful term for distance: gradient. Hypot_g is to distinguish it from initial gradient = |dx| + |dy|.

On Fri, Apr 12, 2019, 1:41 PM Todor Arnaudov notifications@github.com wrote:

The name of hypot_g

I am watching the updates in Khan's repository, intra_comp and I see you stick to the Python function name hypot, but IMO a more suggestive name for the CogAlg function is "distance", since we are not working with triangles and that concept is used in the introduction.

"Distance" (2D) or "Length" (for a vector) is also how that function is usually called in computer graphics libraries and shader languages, e.g.

https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/distance.xhtml

Also "hypot" is also only 2D, while distance is generalized for vectors, and I assume that's the goal in the long run, either per derivative and per patterns, and in "clustering": measurement of the distances between the patterns, where a part of the distance is their "pose" - allowed parameter variation within the same-pattern-space, without crossing a border to another pattern, given the selected partitioning of the space of patterns and poses.

def hypotg(P, dert_buff, dert):

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/boris-kz/CogAlg/issues/28, or mute the thread https://github.com/notifications/unsubscribe-auth/AUAXGS4kgnnvFCBWdh- baWH61CmNss0zks5vgMUvgaJpZM4csmw9 .

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

.

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