Michael Abbott

Results 1143 comments of Michael Abbott

I think these are the same functions as `BLAS.set_num_threads(n)` will call, if `BLAS.vendor()` is MKL. For `get_num_threads` you need Julia 1.6 or Compat.jl.

For vectors, the direct sum is `vcat(x, y)` instead of `cat(A, B; dims=(1,2))` for matrices. Is there a clear generalisation to all dimensions? The present function seems to treat any...

For small arrays, calling `log(prod(x))` is a few times quicker again. On crude tests it doesn't seem less accurate when it works, although for large enough arrays it gives `Inf`....

Sure. My guess is that never doing this for long vectors is probably a sensible heuristic, guessing they will often overflow (and are expensive to traverse twice). For short ones,...

Maybe it's clearer to think in terms of how many `nextfloat`s it's wrong by. Here's some code to try, results I see: * The errors are very strongly correlated with...

The answer for pathalogical cases is numbers near to 1, one of which was in the tests. With my code just above: ```julia julia> x1p = fill(nextfloat(1.0), 100); julia> countsumlog(x1p)...

The goals seem fine to me. * Does goal 1 imply that `0.0` and `NaN` etc. should propagate as usual? They give errors with `exponent`, which I tried to work...

`logprod` is a neat idea to avoid checks. `frexp` is also clearly what we were looking for. Does this have any effect on speed? I am lost in all the...

Possibly this should avoid mapslices, something like this? ```julia Statistics._median(v::AbstractVector, dims::Integer) = dims==1 ? [median!(collect(v))] : collect(v) function Statistics._median(A::AbstractArray{T,N}, dims) where {T,N} iter = Iterators.product(ntuple(d -> (d in dims) ?...

`median` only really needs `map(... eachslice)`, it can skip the other half of `mapslices` which glues things back together again. But `eachslice` is limited to one iteration dimension right now.