-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathplot-utils-svm.jl
More file actions
31 lines (28 loc) · 1010 Bytes
/
plot-utils-svm.jl
File metadata and controls
31 lines (28 loc) · 1010 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import PGFPlots
function plot_svm(outstruct, sol, name="tr-qr")
Comp_pg = outstruct.solver_specific[:SubsolverCounter]
objdec = outstruct.solver_specific[:Fhist] + outstruct.solver_specific[:Hhist]
x = outstruct.solution
a = PGFPlots.Axis(
[
PGFPlots.Plots.MatrixPlot(reshape(x, 28, 28);
colormap = PGFPlots.ColorMaps.GrayMap())#, zmin = -700, zmax = 700)#, legendentry="computed"),
],
)
PGFPlots.save("svm-$(name).pdf", a)
b = PGFPlots.Axis(
PGFPlots.Plots.Linear(1:length(Comp_pg), Comp_pg, mark="none"),
xlabel="outer iterations",
ylabel="inner iterations",
ymode="log",
)
PGFPlots.save("svm-inner-outer-$(name).pdf", b)
c = PGFPlots.Axis(
PGFPlots.Plots.Linear(1:length(objdec), objdec, mark="none"),
xlabel="\$ k^{th}\$ \$ \\nabla f \$ Call",
ylabel="Objective Value",
ymode="log",
)
PGFPlots.save("svm-objdec-$(name).pdf", c)
return objdec
end