Giter VIP home page Giter VIP logo

fastconv.jl's People

Contributors

aamini avatar moustachio-belvedere avatar nlw0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

fastconv.jl's Issues

Julia vs. MATLAB

Thanks for making this code available. I wonder whether the "FastConv" name is promising too much, though.

I did some benchmarks against MATLAB. Julia seems comparable in 1D but MATLAB seems quite a bit faster in 2D. Presumably MATLAB is calling MKL?

julia> w = rand(5,5);
julia> s = rand(32,32);
julia> @time for iter=1:1000;convn(s,w);end
  0.424601 seconds (204.00 k allocations: 178.574 MB, 2.38% gc time)
julia> @time for iter=1:1000;convn(s,w);end
  0.491745 seconds (204.00 k allocations: 178.574 MB, 2.24% gc time)
julia> w = rand(3,3);
julia> @time for iter=1:1000;convn(s,w);end
  0.047446 seconds (8.00 k allocations: 9.415 MB)
julia> @time for iter=1:1000;convn(s,w);end
  0.048083 seconds (8.00 k allocations: 9.415 MB, 3.62% gc time)
>> s = rand(32,32);
>> w = rand(5,5);
>> tic;for iter=1:1000;conv2(s,w);end;toc
Elapsed time is 0.102509 seconds.
>> tic;for iter=1:1000;conv2(s,w);end;toc
Elapsed time is 0.027208 seconds.
>> w = rand(3,3);
>> tic;for iter=1:1000;conv2(s,w);end;toc
Elapsed time is 0.019014 seconds.
>> tic;for iter=1:1000;conv2(s,w);end;toc
Elapsed time is 0.018701 seconds.

Plans to publish on the standard julia repository?

First, let me say this looks like a useful package. But when I attempted to add this package via ] add FastConv, and it wasn't found. Do you intend to publish this to the common repository? I have been informed that to publish there, one needs to make use of the attobot.

Deprecations on Julia 0.7/1.0

Running Julia 0.7 on Windows 7 I get the following:

julia> using FastConv
[ Info: Recompiling stale cache file C:\Users\louis.kaplan\.julia\compiled\v0.7\FastConv\S3Jhd.ji for FastConv [d7899f00-a588-5e12-9855-37624a64ff9a]
┌ Warning: Deprecated syntax `parametric method syntax convn{T, N}(E::Array{T, N}, k::Array{T, N})` around C:\Users\louis.kaplan\.julia\packages\FastConv\SESra\src\utils.jl:10.
│ Use `convn(E::Array{T, N}, k::Array{T, N}) where {T, N}` instead.
└ @ C:\Users\louis.kaplan\.julia\packages\FastConv\SESra\src\utils.jl:10
┌ Warning: Deprecated syntax `parametric method syntax fastconv{T, N}(E::Array{T, N}, k::Array{T, N})` around C:\Users\louis.kaplan\.julia\packages\FastConv\SESra\src\utils.jl:32.
│ Use `fastconv(E::Array{T, N}, k::Array{T, N}) where {T, N}` instead.
└ @ C:\Users\louis.kaplan\.julia\packages\FastConv\SESra\src\utils.jl:32
┌ Warning: Deprecated syntax `parametric method syntax convn!{T, N}(out::Array{T}, E::Array{T, N}, k::Array{T, N})` around C:\Users\louis.kaplan\.julia\packages\FastConv\SESra\src\utils.jl:47.
│ Use `convn!(out::Array{T}, E::Array{T, N}, k::Array{T, N}) where {T, N}` instead.
└ @ C:\Users\louis.kaplan\.julia\packages\FastConv\SESra\src\utils.jl:47

Edit: Planning to put in a PR over the next few days to fix this

Calculation

Thank you for this work!

I understand convolution in math and CV, but the result of running this code surprises me:

...
EX = convn(stack, sobel3_x/2);
ET = convn(stack, prewitt2_t/2);
println(size(stack))
println(size(sobel3_x/2))
println(size(EX))
println(size(prewitt2_t/2))
println(size(ET))

Output:
(4,4,2)
(3,3,2)
(6,6,3) <-- How the output has this dimension?
(2,2,2)
(5,5,3) <-- How the output has this dimension?

The convs I saw has output the same size as the input image. I am new to Julia so not clear about your codes... Could you explain how the codes get this result?

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.