@simeonschaub and @tkoolen Hi guys and thank you very much for your help. Maybe I wasn’t clear enough and I am sorry for that. As you guys affirm the code that tkoolen provided and the code I provided work in a new Julia session. But I am saying that when I try to implement it on my code (when I try to incorporate it in my code) it generates the following error:
ERROR: LoadError: MethodError: no method matching (::PolynomialKernel{Int64,Int64})(::Array{Float64,1}, ::Array{ForwardDiff.Dual{ForwardDiff.Tag{getfield(PreImageProblems, Symbol("##4#5")){KernelPCA{Float64},DataType,typeof(PreImageProblems.cost_function)},Float64},Float64,2},1})
Closest candidates are:
PolynomialKernel(::Array{T₃<:Real,1}, ::Array{T₃<:Real,1}) where T₃<:Real at /home/x_user/.julia/dev/PreImageProblems/src/PreImageProblems.jl:28
PolynomialKernel(::Union{AbstractArray{T₃<:Real,1}, AbstractArray{T₃<:Real,2}}, ::Union{AbstractArray{T₃<:Real,1}, AbstractArray{T₃<:Real,2}}) where T₃<:Real at /home/x_user/.julia/dev/PreImageProblems/src/PreImageProblems.jl:35
Stacktrace:
[1] cost_function(::KernelPCA{Float64}, ::Type{Denoising}, ::Array{ForwardDiff.Dual{ForwardDiff.Tag{getfield(PreImageProblems, Symbol("##4#5")){KernelPCA{Float64},DataType,typeof(PreImageProblems.cost_function)},Float64},Float64,2},1}) at /home/x_user/.julia/dev/PreImageProblems/src/pre_image_problem.jl:33
[2] (::getfield(PreImageProblems, Symbol("##4#5")){KernelPCA{Float64},DataType,typeof(PreImageProblems.cost_function)})(::Array{ForwardDiff.Dual{ForwardDiff.Tag{getfield(PreImageProblems, Symbol("##4#5")){KernelPCA{Float64},DataType,typeof(PreImageProblems.cost_function)},Float64},Float64,2},1}) at /home/x_user/.julia/dev/PreImageProblems/src/pre_image_problem.jl:87
[3] vector_mode_gradient(::getfield(PreImageProblems, Symbol("##4#5")){KernelPCA{Float64},DataType,typeof(PreImageProblems.cost_function)}, ::Array{Float64,1}, ::ForwardDiff.GradientConfig{ForwardDiff.Tag{getfield(PreImageProblems, Symbol("##4#5")){KernelPCA{Float64},DataType,typeof(PreImageProblems.cost_function)},Float64},Float64,2,Array{ForwardDiff.Dual{ForwardDiff.Tag{getfield(PreImageProblems, Symbol("##4#5")){KernelPCA{Float64},DataType,typeof(PreImageProblems.cost_function)},Float64},Float64,2},1}}) at /home/x_user/.julia/packages/ForwardDiff/N0wMF/src/apiutils.jl:37
[4] gradient(::Function, ::Array{Float64,1}, ::ForwardDiff.GradientConfig{ForwardDiff.Tag{getfield(PreImageProblems, Symbol("##4#5")){KernelPCA{Float64},DataType,typeof(PreImageProblems.cost_function)},Float64},Float64,2,Array{ForwardDiff.Dual{ForwardDiff.Tag{getfield(PreImageProblems, Symbol("##4#5")){KernelPCA{Float64},DataType,typeof(PreImageProblems.cost_function)},Float64},Float64,2},1}}, ::Val{true}) at /home/x_user/.julia/packages/ForwardDiff/N0wMF/src/gradient.jl:17
[5] gradient(::Function, ::Array{Float64,1}, ::ForwardDiff.GradientConfig{ForwardDiff.Tag{getfield(PreImageProblems, Symbol("##4#5")){KernelPCA{Float64},DataType,typeof(PreImageProblems.cost_function)},Float64},Float64,2,Array{ForwardDiff.Dual{ForwardDiff.Tag{getfield(PreImageProblems, Symbol("##4#5")){KernelPCA{Float64},DataType,typeof(PreImageProblems.cost_function)},Float64},Float64,2},1}}) at /home/x_user/.julia/packages/ForwardDiff/N0wMF/src/gradient.jl:15 (repeats 2 times)
[6] #update_step#3(::Float64, ::Float64, ::Function, ::KernelPCA{Float64}, ::Type{WithRespectToData}, ::Type{Denoising}, ::Array{Float64,1}, ::Int64, ::typeof(PreImageProblems.cost_function)) at /home/x_user/.julia/dev/PreImageProblems/src/pre_image_problem.jl:87
[7] update_step at /home/x_user/.julia/dev/PreImageProblems/src/pre_image_problem.jl:71 [inlined]
[8] pre_image_non_neg_constraint(::Type{KernelPCA}, ::PolynomialKernel{Int64,Int64}, ::Type{Denoising}, ::Type{WithRespectToData}, ::Array{Float64,2}, ::Int64) at /home/x_user/.julia/dev/PreImageProblems/src/pre_image_problem.jl:50
[9] top-level scope at none:0
in expression starting at /home/x_user/.julia/dev/PreImageProblems/src/polyDataDenoisExp.jl:76
I believe that the version of Julia and other packages is updated, but anyway please find following the result of version checking:
julia> versioninfo()
Julia Version 1.1.0
Commit 80516ca202 (2019-01-21 21:24 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-6.0.1 (ORCJIT, skylake)
Environment:
JULIA_EDITOR = atom -a
JULIA_NUM_THREADS = 6
If you guys have the nerve to investigate further this story I will be happy to provide you details in order to proceed further with a minimal working code.
Again I thank you very much for your support.
Cheers.
Ergnoor