Hello, I’m a student using Julia in my project making deep learning model.
I usually use ‘matrix multiplication’ a lot in my code.
then, I found some result is weird.
I think it’s better to show some examples than to explain.
julia> temp = randn(3,3)
3×3 Array{Float64,2}:
-0.354025 -0.12966 0.178489
-1.26627 -0.648564 -1.39475
-1.86577 0.401252 1.16448
julia> temp1 = rand(3,2)
3×2 Array{Float64,2}:
0.346108 0.895262
0.852009 0.508729
0.201902 0.831357
julia> out = temp * temp1
3×2 Array{Float64,2}:
-0.196965 -0.234519
-1.27245 -2.62313
-0.0687769 -0.498126
julia> out[1] # result_1
-0.19696523721990802
julia> sum(temp[1,:] .* temp1[:,1]) # result_2
-0.19696523721990805
as far as I know, ‘the result_1’ and the ‘result_2’ have to be same.
I don’t know why the result like this.