ADCMEKit.animate
— Methodanimate(update::Function, frames; kwargs...)
Creates an animation using update function update
.
Example
θ = LinRange(0, 2π, 100)
x = cos.(θ)
y = sin.(θ)
pl, = plot([], [], "o-")
t = title("0")
xlim(-1.2,1.2)
ylim(-1.2,1.2)
function update(i)
t.set_text("$i")
pl.set_data([x[1:i] y[1:i]]'|>Array)
end
animate(update, 1:100)
ADCMEKit.jacview
— Methodu0 = rand(10)
function verify_jacobian_f(θ, u)
r = u^3+u - u0
r, spdiag(3u^2+1.0)
end
verify_jacobian(sess, verify_jacobian_f, missing, u0); close("all")
# least square
u0 = rand(10)
rs = rand(10)
function verify_jacobian_f(θ, u)
r = [u^2;u] - [rs;rs]
r, [spdiag(2*u); spdiag(10)]
end
verify_jacobian(sess, verify_jacobian_f, missing, u0); close("all")
ADCMEKit.lineview
— Functionlineview(sess::PyObject, pl::PyObject, loss::PyObject, θ1, θ2=nothing; n::Integer = 10)
Plots the function
\[h(α) = f((1-α)θ_1 + αθ_2)\]
Example
pl = placeholder(Float64, shape=[2])
l = sum(pl^2-pl*0.1)
sess = Session(); init(sess)
lineview(sess, pl, l, rand(2))
ADCMEKit.save_tikz
— Methodsave_tikz(filename::String)
Saves the current figure to tex files.
ADCMEKit.saveanim
— Methodsaveanim(anim::PyObject, filename::String; kwargs...)
Saves the animation produced by animate