Giter Club home page Giter Club logo

basisfunctionexpansions.jl's People

Contributors

baggepinnen avatar femtocleaner[bot] avatar github-actions[bot] avatar juliatagbot avatar valentinkaisermayer 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

Watchers

 avatar  avatar  avatar  avatar

basisfunctionexpansions.jl's Issues

New ambiguity on Julia 1.3

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.

How to get basis coefficients?

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?

plotrecipes dep

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.

TODO

  • Initialization by clustering
  • Support also full covariance matrix using the clustering initialization
  • Additional basis functions
  • Parameter covariance
  • Output covariance

Plot recipe for rbf is broken

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

Derivatives

Provide gradients for all activation functions.

Wrong Normalization

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:
activation_2

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

Which yields:
activation

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

This assumes that vc is ordered increasingly.
activation

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.