Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

explain the column-major orientation convention #143

Open
johnnychen94 opened this issue Jul 1, 2020 · 0 comments
Open

explain the column-major orientation convention #143

johnnychen94 opened this issue Jul 1, 2020 · 0 comments
Labels
best practice workflows and best practice that are useful in JuliaImages and/or Julia

Comments

@johnnychen94
Copy link
Member

johnnychen94 commented Jul 1, 2020

Not sure if this is documented somewhere, but the column-major orientation seems to cause some confusion and is abused somehow.

One such example is that Flux follows the same convention from Pytorch and Tensorflow, calling it WHCN order, while almost the whole community uses permutedims(channelview(X), (2, 3, 1)) to convert the data. Yes, this is more friendly to memory layout than permutedims(..., (3, 2, 1)), but it is actually HWCN order. Even the Flux community isn't fully aware of this, e.g., JuliaML/MLDatasets.jl#34

We may also need to compare other image-processing libraries; by default, MATLAB to follow the same column-major order while numpy, on the other hand, takes row-major order.

Thanks @pauljurczak for raising this issue in #142

@johnnychen94 johnnychen94 changed the title explain the orientation convention explain the column-major orientation convention Jul 1, 2020
@johnnychen94 johnnychen94 added the best practice workflows and best practice that are useful in JuliaImages and/or Julia label Aug 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
best practice workflows and best practice that are useful in JuliaImages and/or Julia
Projects
None yet
Development

No branches or pull requests

1 participant