Skip to content

Commit 756f470

Browse files
committed
fix
1 parent 028fc4b commit 756f470

File tree

2 files changed

+0
-62
lines changed

2 files changed

+0
-62
lines changed

src/Argmax2D/Argmax2D.jl

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,13 @@ Custom constructor for [`Argmax2DBenchmark`](@ref).
4040
"""
4141
function Argmax2DBenchmark(; nb_features::Int=5, seed=nothing, polytope_vertex_range=[6])
4242
Random.seed!(seed)
43-
<<<<<<< Updated upstream
44-
model = Chain(Dense(nb_features => 2; bias=false), vec)
45-
return Argmax2DBenchmark(nb_features, model, polytope_vertex_range)
46-
end
47-
48-
maximizer(θ; instance) = instance[argmax(dot(θ, v) for v in instance)]
49-
=======
5043
model = Dense(nb_features => 2; bias=false)
5144
return Argmax2DBenchmark(nb_features, model, polytope_vertex_range)
5245
end
5346

5447
Utils.is_minimization_problem(::Argmax2DBenchmark) = false
5548

5649
maximizer(θ; instance, kwargs...) = instance[argmax(dot(θ, v) for v in instance)]
57-
>>>>>>> Stashed changes
5850

5951
"""
6052
$TYPEDSIGNATURES
@@ -66,11 +58,7 @@ function Utils.generate_dataset(
6658
)
6759
(; nb_features, encoder, polytope_vertex_range) = bench
6860
return map(1:dataset_size) do _
69-
<<<<<<< Updated upstream
70-
x = randn(rng, nb_features)
71-
=======
7261
x = randn(rng, Float32, nb_features)
73-
>>>>>>> Stashed changes
7462
θ_true = encoder(x)
7563
θ_true ./= 2 * norm(θ_true)
7664
instance = build_polytope(rand(rng, polytope_vertex_range); shift=rand(rng))
@@ -98,12 +86,6 @@ function Utils.generate_statistical_model(
9886
)
9987
Random.seed!(rng, seed)
10088
(; nb_features) = bench
101-
<<<<<<< Updated upstream
102-
model = Chain(Dense(nb_features => 2; bias=false), vec)
103-
return model
104-
end
105-
106-
=======
10789
model = Dense(nb_features => 2; bias=false)
10890
return model
10991
end
@@ -115,22 +97,12 @@ function Utils.plot_data(::Argmax2DBenchmark; instance, θ, kwargs...)
11597
return plot_maximizer!(pl, θ, instance, maximizer)
11698
end
11799

118-
>>>>>>> Stashed changes
119100
"""
120101
$TYPEDSIGNATURES
121102
122103
Plot the data sample for the [`Argmax2DBenchmark`](@ref).
123104
"""
124105
function Utils.plot_data(
125-
<<<<<<< Updated upstream
126-
::Argmax2DBenchmark, sample::DataSample; θ_true=sample.θ_true, kwargs...
127-
)
128-
(; instance) = sample
129-
pl = init_plot()
130-
plot_polytope!(pl, instance)
131-
plot_objective!(pl, θ_true)
132-
return plot_maximizer!(pl, θ_true, instance, maximizer)
133-
=======
134106
::Argmax2DBenchmark,
135107
sample::DataSample;
136108
instance=sample.instance,
@@ -141,7 +113,6 @@ function Utils.plot_data(
141113
plot_polytope!(pl, instance)
142114
plot_objective!(pl, θ)
143115
return plot_maximizer!(pl, θ, instance, maximizer)
144-
>>>>>>> Stashed changes
145116
end
146117

147118
export Argmax2DBenchmark

src/Argmax2D/polytope.jl

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -21,29 +21,16 @@ function plot_polytope!(pl, vertices)
2121
fillcolor=:gray,
2222
fillalpha=0.2,
2323
linecolor=:black,
24-
<<<<<<< Updated upstream
25-
label=L"\mathrm{conv}(\mathcal{V})",
26-
)
27-
end;
28-
29-
const logocolors = Colors.JULIA_LOGO_COLORS
30-
31-
=======
3224
label=L"\mathrm{conv}(\mathcal{Y}(x))",
3325
)
3426
end;
3527

36-
>>>>>>> Stashed changes
3728
function plot_objective!(pl, θ)
3829
Plots.plot!(
3930
pl,
4031
[0.0, θ[1]],
4132
[0.0, θ[2]];
42-
<<<<<<< Updated upstream
43-
color=logocolors.purple,
44-
=======
4533
color=Colors.JULIA_LOGO_COLORS.purple,
46-
>>>>>>> Stashed changes
4734
arrow=true,
4835
lw=2,
4936
label=nothing,
@@ -58,11 +45,7 @@ function plot_maximizer!(pl, θ, instance, maximizer)
5845
pl,
5946
[ŷ[1]],
6047
[ŷ[2]];
61-
<<<<<<< Updated upstream
62-
color=logocolors.red,
63-
=======
6448
color=Colors.JULIA_LOGO_COLORS.red,
65-
>>>>>>> Stashed changes
6649
markersize=9,
6750
markershape=:square,
6851
label=L"f(\theta)",
@@ -91,23 +74,15 @@ end;
9174
# fillcolor=:blue,
9275
# fillalpha=0.1,
9376
# linestyle=:dash,
94-
<<<<<<< Updated upstream
95-
# linecolor=logocolors.blue,
96-
=======
9777
# linecolor=Colors.JULIA_LOGO_COLORS.blue,
98-
>>>>>>> Stashed changes
9978
# label=L"\mathrm{conv}(\hat{p}(\theta))",
10079
# )
10180
# return Plots.scatter!(
10281
# pl,
10382
# map(first, A),
10483
# map(last, A);
10584
# markersize=25 .* p .^ 0.5,
106-
<<<<<<< Updated upstream
107-
# markercolor=logocolors.blue,
108-
=======
10985
# markercolor=Colors.JULIA_LOGO_COLORS.blue,
110-
>>>>>>> Stashed changes
11186
# markerstrokewidth=0,
11287
# markeralpha=0.4,
11388
# label=L"\hat{p}(\theta)",
@@ -120,23 +95,15 @@ end;
12095
# pl,
12196
# [ŷΩ[1]],
12297
# [ŷΩ[2]];
123-
<<<<<<< Updated upstream
124-
# color=logocolors.blue,
125-
=======
12698
# color=Colors.JULIA_LOGO_COLORS.blue,
127-
>>>>>>> Stashed changes
12899
# markersize=6,
129100
# markershape=:hexagon,
130101
# label=L"\hat{f}(\theta)",
131102
# )
132103
# end;
133104

134105
# function compress_distribution!(
135-
<<<<<<< Updated upstream
136-
# probadist::FixedAtomsProbabilityDistribution{A,W}; atol=0
137-
=======
138106
# probadist::DifferentiableExpectations.FixedAtomsProbabilityDistribution{A,W}; atol=0
139-
>>>>>>> Stashed changes
140107
# ) where {A,W}
141108
# (; atoms, weights) = probadist
142109
# to_delete = Int[]

0 commit comments

Comments
 (0)