baggepinnen / basisfunctionexpansions.jl Goto Github PK
View Code? Open in Web Editor NEWBasis Function Expansions for Julia
License: Other
Basis Function Expansions for Julia
License: Other
While running the package tests for the upcoming 1.3, a new ambiguity in this package was detected:
ERROR: LoadError: LoadError: MethodError: LPVSS(::MultiRBFE{BasisFunctionExpansions.var"##21#25"{Array{Float64,2},Array{Array{Float64,2},1}},Array{Float64,2},Array{Float64,2}}, ::Array{Float64,2}, ::Array{Float64,2}, ::Array{Float64,1}) is ambiguous. Candidates:
LPVSS(bfe::BasisFunctionExpansion, params, cov, σ) in BasisFunctionExpansions at /root/.julia/packages/BasisFunctionExpansions/tggwO/src/dynamics.jl:81
LPVSS(x, u, v::Union{AbstractArray{T,1}, AbstractArray{T,2}} where T, nc) in BasisFunctionExpansions at /root/.julia/packages/BasisFunctionExpansions/tggwO/src/dynamics.jl:154
Possible fix, define
LPVSS(::BasisFunctionExpansion, ::Any, ::Union{AbstractArray{T,1}, AbstractArray{T,2}} where T, ::Any)
Stacktrace:
[1] #LPVSS#62(::Bool, ::Float64, ::Type{LPVSS}, ::Adjoint{Float64,Array{Float64,2}}, ::Adjoint{Float64,Array{Float64,2}}, ::Int64) at /root/.julia/packages/BasisFunctionExpansions/tggwO/src/dynamics.jl:120
[2] (::Core.var"#kw#Type")(::NamedTuple{(:normalize, :λ),Tuple{Bool,Float64}}, ::Type{LPVSS}, ::Adjoint{Float64,Array{Float64,2}}, ::Adjoint{Float64,Array{Float64,2}}, ::Int64) at ./none:0
[3] top-level scope at /root/.julia/packages/BasisFunctionExpansions/tggwO/test/test_LPVSS.jl:25
[4] include at ./boot.jl:328 [inlined]
[5] include_relative(::Module, ::String) at ./loading.jl:1105
[6] include(::Module, ::String) at ./Base.jl:31
[7] include(::String) at ./client.jl:432
[8] top-level scope at /root/.julia/packages/BasisFunctionExpansions/tggwO/test/runtests.jl:123
[9] include at ./boot.jl:328 [inlined]
[10] include_relative(::Module, ::String) at ./loading.jl:1105
[11] include(::Module, ::String) at ./Base.jl:31
[12] include(::String) at ./client.jl:432
[13] top-level scope at none:6
in expression starting at /root/.julia/packages/BasisFunctionExpansions/tggwO/test/test_LPVSS.jl:25
in expression starting at /root/.julia/packages/BasisFunctionExpansions/tggwO/test/runtests.jl:123
We believe this is a real ambiguity that got detected due to improvements in the Julia type system and thus needs to be fixed in this package.
First off, thanks for this package!
Is there an API to retrieve basis coefficients and reconstruct approximation objects? I need to retrieve coefficients of approximation, do some calculations with them, generate new coefficients and reconstruct a signal with the updated coefficients using the same radial basis.
Please let me know how I can achieve this. If there is no exposed API yet, is it safe to lookup bfa.linear_combinations
?
For example, consider the problem y=Mx, where M is mxn dimension and a set of basis functions. Is there a way that we can estimate the basis functions in M here?
Hi,
this package depends on PlotRecipes, but you don't seem to be using it. I'm guessing it's a mistake and the REQUIRE file should hold RecipesBase
instead?
BTW very pretty graphs. I believe that the color bar issue with the Plotly surface should be solved on current Plots.
Copying/pasting the example in the docs:
N = 200
v = linspace(0,10,N)
y = 0.1*(v-2).*(v-7) + 0.2randn(N)
rbf = UniformRBFE(v, 5, normalize = true)
bfa = BasisFunctionApproximation(y,v,rbf)
scatter(v,y,lab="Signal",c=:orange, subplot=1, xlabel="\$v\$", size=(600,300))
plot!(rbf) # this is broken
plot!(v,bfa(v),lab="Reconstruction",c=:blue,linewidth=2)
UndefVarError: HSV not defined
@JuliaRegistrator register
Provide gradients for all activation functions.
The normalized variant of the RBF seems to be wrong.
function normalized_squared_exponential(v, vc, gamma::Number)
r = squared_exponential(v, vc, gamma)
r ./= (sum(r, dims=2) .+ 1e-8)
end
Which yields the incorrect extrapolation behaviour:
The correct implementation would be
function normalized_squared_exponential(v, vc, gamma::Number)
r = squared_exponential(v, vc, gamma)
r ./= (sum(r, dims=2))
end
However, for points that are really far outside of the support of the RBF this does not work either.
I have a somewhat hacked solution:
function normalized_squared_exponential(v, vc, gamma::Number)
r = squared_exponential(v, vc, gamma)
s = vec(sum(r, dims=2))
r ./= s
r[isnan.(r)] .= 0.
r[(s .<= eps()) .& (v .< vc[1]), 1] .= 1.
r[(s .<= eps()) .& (v .> vc[end]), end] .= 1.
r
end
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.