Michael Abbott
Michael Abbott
I get the same error just calling `argmax` directly, so I think this is a Reactant.jl problem: ```julia julia> using Reactant, MLDataDevices, OneHotArrays julia> argmax([true false false; false true true];...
Before Julia 1.7, I believe this would have done `K += (k * X) * X'`, which also seems fast now. After 3-arg `*`, this calls `K += broadcast(*, k,...
You might be looking for `Conv(weights; pad=(1,1))`? I.e. there's a method which accepts `weights::Array`, for exactly this purpose. It does not take `(3, 3), 1 => 1` since, as you...
The check if we do want one could look like this -- maybe not as messy as I pictured it being, at first: ```julia function _sizecheck(f, sz::Integer...) W = f(sz...)...
In addition to `X::StridedMatrix{ evalpoly([1 2; 3 4], (5, 6)) # error without this PR 2×2 Matrix{Int64}: 11 12 18 29 julia> evalpoly([1 2; 3 4], (5, 6.7)) ERROR: InexactError:...
Ah now I see some logic for `p[begin]` which my examples happened to avoid. Only accepting `p::NTuple` (and concretely typed vectors) seems fine really. And perhaps even `StridedMatrix{
This is a little harder to fool, but: ```julia julia> evalpoly([1 2; 3 4], Number[5.5, 6]) ERROR: InexactError: Int64(11.5) julia> evalpoly([1.0 2.0; 3.0 4.0], Number[2, 3, 4+im]) ERROR: InexactError: Float64(4.0...
I have no strong feelings... my examples above invented to break this do seem unlikely to show up in the wild.
The problem is that the principle thing a OneHotArray is good for is that multiplying from the left with a matrix can be done efficiently... and that calls `NNlib.scatter`: https://github.com/FluxML/OneHotArrays.jl/blob/0b49d1b39ad5d1ab8ed212da3ff2e180985e2591/src/linalg.jl#L7-L11...
I have never used CategoricalArrays, but it seems to be backed by a `Vector{UInt32}` which is exactly what `OneHotArray` likes too: ```julia julia> using CategoricalArrays, OneHotArrays julia> categs = categorical(string.([:a,...