Code Monkey home page Code Monkey logo

Comments (6)

Datseris avatar Datseris commented on May 27, 2024 2

So, they are skipped.

from complexitymeasures.jl.

Datseris avatar Datseris commented on May 27, 2024 1

I'll post my comments on #74.

from complexitymeasures.jl.

kahaaga avatar kahaaga commented on May 27, 2024

I would like the possibility to calculate a permutation of 2D and 3D objects (possibly images, or 1D spatiotemporal systems in the 2D case, and 2D spatiotemporal systems or volumes in the 3D case).

That would indeed be useful!

An example for the 2D version is given in Ribero et al. (2012), and a 3D version is described in Schlemmer et al. (2018). Essentially, you take a subarray out of the original array, flatten it and calculate the permutation index of the resulting pattern.

But I would like to have this method in a much more generic way than it is presented in the papers above, where any "stencil shape" can be used, not just rectangles (2D) or the "tripod" in the 3D case. This can be realized by allowing the user to give a boolean array to the function. Example. ...
that can then be translated into permutation indices, from which a distribution can be estimated, from which a permutation entropy can be calculated.

Thanks for the references, and for the clear and concise explanation.

From first glance, a basic version of 2D/3D algorithms should be relatively straight-forward to implement. I see applications for my own research here too, so I'll put this on my todo-list.

One could also (but imo does not necessarily need) to implement the option to pass a 2D (3D) lag and length instead of a stencil to easily get rectangular shaped stencils, similar to what's already described in the Ribero paper and implemented in the ordpy library.

Custom-shaped stencils sound useful. Do you have a concrete example with (like you provided above for the square case) that illustrate precisely what you envision?

from complexitymeasures.jl.

ikottlarz avatar ikottlarz commented on May 27, 2024

Custom-shaped stencils sound useful. Do you have a concrete example with (like you provided above for the square case) that illustrate precisely what you envision?

I'm not exactly sure if this is what you were asking for, but for example the stencil corresponding to the tripod in Schlemmer et al. would look like

julia> stencil
2×2×2 Array{Float64, 3}:
[:, :, 1] =
 1.0  1.0
 1.0  0.0

[:, :, 2] =
 1.0  0.0
 0.0  0.0

I don't think there are any other publications using other custom shapes (yet), but I think it is much easier this way than always providing a specific lag and word length to try to build the 2D or 3D patterns. Also, this gives more room for extension, if one ever wants to try other shapes for some reason.

I'm not sure how you would go about this in Julia the most efficient way, I know that in python, there are functions in ML libraries (like the unfold operation) that can very efficiently extract patches from arrays, maybe that's a thing in Julia too. So once you have collected the patches into an array of a shape [n_patches_x, n_patches_y, stencil_x, stencil_y], you can just go and do

patterns = patches[...,stencil]

from complexitymeasures.jl.

Datseris avatar Datseris commented on May 27, 2024

@ikottlarz or @kahaaga can either of your tell me what is the typical thing people do when indices exceed the array bounds? Like if I reach the lower right pixel and the stencil is a 2x2 square, three indices are out of bounds. what do people tupically do in these scenarios?

from complexitymeasures.jl.

ikottlarz avatar ikottlarz commented on May 27, 2024

@Datseris same as for the 1D case: You don't consider it a pattern. The last pattern is the last one fully contained in the data.

from complexitymeasures.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.