@@ -51,75 +51,3 @@ function plot_maximizer!(pl, θ, instance, maximizer)
5151 label= L " f(\t heta)" ,
5252 )
5353end ;
54-
55- # function get_angle(v)
56- # @assert !(norm(v) ≈ 0)
57- # v = v ./ norm(v)
58- # if v[2] >= 0
59- # return acos(v[1])
60- # else
61- # return π + acos(-v[1])
62- # end
63- # end;
64-
65- # function plot_distribution!(pl, probadist)
66- # A = probadist.atoms
67- # As = sort(A; by=get_angle)
68- # p = probadist.weights
69- # Plots.plot!(
70- # pl,
71- # vcat(map(first, As), first(As[1])),
72- # vcat(map(last, As), last(As[1]));
73- # fillrange=0,
74- # fillcolor=:blue,
75- # fillalpha=0.1,
76- # linestyle=:dash,
77- # linecolor=Colors.JULIA_LOGO_COLORS.blue,
78- # label=L"\mathrm{conv}(\hat{p}(\theta))",
79- # )
80- # return Plots.scatter!(
81- # pl,
82- # map(first, A),
83- # map(last, A);
84- # markersize=25 .* p .^ 0.5,
85- # markercolor=Colors.JULIA_LOGO_COLORS.blue,
86- # markerstrokewidth=0,
87- # markeralpha=0.4,
88- # label=L"\hat{p}(\theta)",
89- # )
90- # end;
91-
92- # function plot_expectation!(pl, probadist)
93- # ŷΩ = compute_expectation(probadist)
94- # return scatter!(
95- # pl,
96- # [ŷΩ[1]],
97- # [ŷΩ[2]];
98- # color=Colors.JULIA_LOGO_COLORS.blue,
99- # markersize=6,
100- # markershape=:hexagon,
101- # label=L"\hat{f}(\theta)",
102- # )
103- # end;
104-
105- # function compress_distribution!(
106- # probadist::DifferentiableExpectations.FixedAtomsProbabilityDistribution{A,W}; atol=0
107- # ) where {A,W}
108- # (; atoms, weights) = probadist
109- # to_delete = Int[]
110- # for i in length(probadist):-1:1
111- # ai = atoms[i]
112- # for j in 1:(i - 1)
113- # aj = atoms[j]
114- # if isapprox(ai, aj; atol=atol)
115- # weights[j] += weights[i]
116- # push!(to_delete, i)
117- # break
118- # end
119- # end
120- # end
121- # sort!(to_delete)
122- # deleteat!(atoms, to_delete)
123- # deleteat!(weights, to_delete)
124- # return probadist
125- # end;
0 commit comments