GithubHelp home page GithubHelp logo

Comments (5)

stevengj avatar stevengj commented on June 3, 2024

Fair enough. The hadamard function just takes the FWHT of the columns of the identity matrix, which is certainly not the most efficient way to do things. (Does it matter? I thought that performance-sensitive cases would mainly use the FWHT.)

Regarding non powers of two, I could certainly have a table of Hadamard matrices for various factors, and then build other sizes from Kronecker products of these. However, I have three concerns:

  • Is this actually useful? Who needs Hadamard matrices of non-power-of-two sizes?
  • Does it matter what ordering I choose? Ordering the factors in different ways seems like it will produce different matrices (albeit equivalent modulo reordering).
  • Does it matter which inequivalent Hadamard matrix I choose, in the common case where there are inequivalent choices for a given factor?

from hadamard.jl.

stevengj avatar stevengj commented on June 3, 2024

Note that it is even faster on my machine to do a "power-by-squaring" algorithm, which keeps the size of the matrices smaller until the last Kronecker product:

function hadsq(m)
    m == 0 && return reshape([1],1,1)
    m == 1 && return H2
    z = hadsq(m >> 1)
    z = kron(z, z)
    iseven(m) ? z : kron(H2, z)
end

from hadamard.jl.

alanedelman avatar alanedelman commented on June 3, 2024

Is this actually useful? Who needs Hadamard matrices of non-power-of-two sizes?

People use them from time to time for experimental design. Not saying it's the world's highest priority.

Does it matter what ordering I choose? Ordering the factors in different ways seems like it will produce different matrices (albeit equivalent modulo reordering).

Does it matter which inequivalent Hadamard matrix I choose, in the common case where there are inequivalent choices for a given factor?

I would say for starters, any one is fine, in part because I'm not sure it's practical to get an exhaustive list of non-Hadamard equivalent matrices for all n anyway, and generating Hadamard
equivalent matrices is easy enough for the user.

from hadamard.jl.

alanedelman avatar alanedelman commented on June 3, 2024

cute

On Mon, Jul 7, 2014 at 9:28 AM, Steven G. Johnson [email protected]
wrote:

Note that it is even faster on my machine to do a "power-by-squaring"
algorithm, which keeps the size of the matrices smaller until the last
Kronecker product:

function hadsq(m)
m == 0 && return reshape([1],1,1)
m == 1 && return H2
z = hadsq(m >> 1)
z = kron(z, z)
iseven(m) ? z : kron(H2, z)
end


Reply to this email directly or view it on GitHub
#2 (comment).

from hadamard.jl.

stevengj avatar stevengj commented on June 3, 2024

Should be mostly fixed. There are a few known orders of Hadamard matrices that aren't supported because I can't yet find the matrices online, but hopefully that will be fixed once a bug in the webhadamard site is fixed (their matrices are currently truncated).

from hadamard.jl.

Related Issues (10)

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.