-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
parametric NDArray #331
parametric NDArray #331
Conversation
src/executor.jl
Outdated
G<:AbstractVector{<:Union{Void,NDArray}}, | ||
O<:VecOfNDArray, | ||
D<:Dict{Symbol,<:NDArray}, | ||
E<:Dict{Symbol,<:NDArray}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is terrible, any better way to deal with abstract container type?
Or we need to redesign Executor
?
c9cdd65
to
d49aa7a
Compare
with parametric NDArray, constructing julia> Dict(:x => x, :y => y)
Dict{Symbol,Any} with 2 entries:
:y => 6 mx.NDArray{Float32,1} @ CPU0:…
:x => 2×3 mx.NDArray{Float32,2} @ CPU0:… |
a7e7c2b
to
0ba8f69
Compare
be00070
to
8bd5f9d
Compare
hmm, I would like to avoid being resolved to Any if possible. |
Actually, same story on julia> x = [1,2]
2-element Array{Int64,1}:
1
2
julia> y = [1 2; 3 4]
2×2 Array{Int64,2}:
1 2
3 4
julia> Dict(:x => x, :y => y)
Dict{Symbol,Any} with 2 entries:
:y => [1 2; 3 4]
:x => [1, 2] |
src/metric.jl
Outdated
mutable struct MSE <: AbstractEvalMetric | ||
mse_sum :: Vector{NDArray} | ||
mutable struct MSE{T<:NDArray} <: AbstractEvalMetric | ||
mse_sum :: Vector{T} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vchuravy I changed MSE
like this, but I got confused that how does user initialize a MSE
instance?
In the example of regression, it just creates a instance via MSE()
.
And...what's your design of struct MSE
if we have parametric NDArray
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is for error reporting only it should simply default to Float64
or Float32
.
The array is simply to not block during _update_single_output
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is for error reporting only it should simply default to
Float64
orFloat32
.
okay, I will init them with MX_float
(Float32
) by default.
The array is simply to not block during
_update_single_output
.
I do not get what you mean.
e42f603
to
4bbef45
Compare
Codecov Report
@@ Coverage Diff @@
## master #331 +/- ##
==========================================
+ Coverage 70.01% 70.08% +0.07%
==========================================
Files 24 24
Lines 1944 1939 -5
==========================================
- Hits 1361 1359 -2
+ Misses 583 580 -3
Continue to review full report at Codecov.
|
This PR is ready for review now. |
good to go ? |
No description provided.