This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Type1 | |
a::Matrix{Float64} # why not vector of vectors? | |
b::Vector{Matrix{Float64}} | |
c::Vector{Float64} | |
d::Float64 | |
e::Int64 | |
end | |
type Type2{T} | |
a::Matrix{T} # why not vector of vectors? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Type1 | |
a::Matrix{Float64} # why not vector of vectors? | |
b::Vector{Matrix{Float64}} | |
c::Vector{Float64} | |
d::Float64 | |
e::Int64 | |
end | |
type Type2{T} | |
a::Matrix{T} # why not vector of vectors? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type ML | |
vector | |
phat | |
end | |
ml = ML(rand(8000), zeros(8000)) | |
function test6(a) | |
@time for i = 1:1000 | |
for j = 1:8000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Devectorize | |
function test0() | |
vector = rand(8000) | |
phat = zeros(8000) | |
@time for i = 1:1000 | |
for j = 1:8000 | |
phat[j] = 1./(1+exp(-vector [j])) | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Create matrix | |
A = rand(3,9) | |
#Sum over rows -> matrix | |
typeof(sum(A, 1)) == Matrix{Float64} #true | |
#Sum over cols -> matrix | |
typeof(sum(A,2)) == Matrix{Float64} #true | |
#This is expected, but what is the best way to extract the vector? This? |
NewerOlder