@@ -40,21 +40,13 @@ Custom constructor for [`Argmax2DBenchmark`](@ref).
4040"""
4141function 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)
5245end
5346
5447Utils. is_minimization_problem (:: Argmax2DBenchmark ) = false
5548
5649maximizer (θ; 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
10991end
@@ -115,22 +97,12 @@ function Utils.plot_data(::Argmax2DBenchmark; instance, θ, kwargs...)
11597 return plot_maximizer! (pl, θ, instance, maximizer)
11698end
11799
118- >>>>>> > Stashed changes
119100"""
120101$TYPEDSIGNATURES
121102
122103Plot the data sample for the [`Argmax2DBenchmark`](@ref).
123104"""
124105function 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
145116end
146117
147118export Argmax2DBenchmark
0 commit comments