@@ -88,10 +88,10 @@ function create_utils_benchmark()
8888 suite[" best_of_sample" ] = @benchmarkable (
8989 best_of_sample (pop, rss, $ options),
9090 setup = (
91- nfeatures = 1 ;
92- dataset = Dataset (randn (nfeatures, 32 ), randn (32 ));
93- pop = Population (dataset; npop= 100 , nlength= 20 , options= $ options, nfeatures);
94- rss = RunningSearchStatistics (; options= $ options)
91+ nfeatures= 1 ;
92+ dataset= Dataset (randn (nfeatures, 32 ), randn (32 ));
93+ pop= Population (dataset; npop= 100 , nlength= 20 , options= ( $ options) , nfeatures);
94+ rss= RunningSearchStatistics (; options= ( $ options) )
9595 )
9696 )
9797
@@ -110,9 +110,9 @@ function create_utils_benchmark()
110110 end
111111 end ,
112112 setup = (
113- nfeatures = 1 ;
114- dataset = Dataset (randn (nfeatures, 32 ), randn (32 ));
115- mutation_weights = MutationWeights (;
113+ nfeatures= 1 ;
114+ dataset= Dataset (randn (nfeatures, 32 ), randn (32 ));
115+ mutation_weights= MutationWeights (;
116116 mutate_constant= 1.0 ,
117117 mutate_operator= 1.0 ,
118118 swap_operands= 1.0 ,
@@ -125,21 +125,23 @@ function create_utils_benchmark()
125125 form_connection= 0.0 ,
126126 break_connection= 0.0 ,
127127 );
128- options = Options (;
129- unary_operators= [sin, cos], binary_operators= [+ , - , * , / ], mutation_weights
128+ options= Options (;
129+ unary_operators= [sin, cos],
130+ binary_operators= [+ , - , * , / ],
131+ mutation_weights,
130132 );
131- recorder = RecordType ();
132- temperature = 1.0 ;
133- curmaxsize = 20 ;
134- rss = RunningSearchStatistics (; options);
135- trees = [
133+ recorder= RecordType ();
134+ temperature= 1.0 ;
135+ curmaxsize= 20 ;
136+ rss= RunningSearchStatistics (; options);
137+ trees= [
136138 gen_random_tree_fixed_size (15 , options, nfeatures, Float64) for _ in 1 : 100
137139 ];
138- expressions = [
140+ expressions= [
139141 Expression (tree; operators= options. operators, variable_names= [" x1" ]) for
140142 tree in trees
141143 ];
142- members = [
144+ members= [
143145 PopMember (dataset, expression, options; deterministic= false ) for
144146 expression in expressions
145147 ]
@@ -153,14 +155,14 @@ function create_utils_benchmark()
153155 end ,
154156 seconds = 20 ,
155157 setup = (
156- nfeatures = 1 ;
157- T = Float64;
158- dataset = Dataset (randn (nfeatures, 512 ), randn (512 ));
159- ntrees = $ ntrees;
160- trees = [
158+ nfeatures= 1 ;
159+ T= Float64;
160+ dataset= Dataset (randn (nfeatures, 512 ), randn (512 ));
161+ ntrees= ( $ ntrees) ;
162+ trees= [
161163 gen_random_tree_fixed_size (20 , $ options, nfeatures, T) for i in 1 : ntrees
162164 ];
163- members = [
165+ members= [
164166 PopMember (dataset, tree, $ options; deterministic= false ) for tree in trees
165167 ]
166168 )
@@ -179,9 +181,9 @@ function create_utils_benchmark()
179181 compute_complexity (tree, $ options)
180182 end ,
181183 setup = (
182- T = Float64;
183- nfeatures = 3 ;
184- trees = [
184+ T= Float64;
185+ nfeatures= 3 ;
186+ trees= [
185187 gen_random_tree_fixed_size (20 , $ options, nfeatures, T) for
186188 i in 1 : ($ ntrees)
187189 ]
@@ -197,9 +199,9 @@ function create_utils_benchmark()
197199 SymbolicRegression. MutationFunctionsModule. randomly_rotate_tree! (tree)
198200 end ,
199201 setup = (
200- T = Float64;
201- nfeatures = 3 ;
202- trees = [
202+ T= Float64;
203+ nfeatures= 3 ;
204+ trees= [
203205 gen_random_tree_fixed_size (20 , $ options, nfeatures, T) for
204206 i in 1 : ($ ntrees)
205207 ]
@@ -214,9 +216,9 @@ function create_utils_benchmark()
214216 )
215217 end ,
216218 setup = (
217- T = Float64;
218- nfeatures = 3 ;
219- trees = [
219+ T= Float64;
220+ nfeatures= 3 ;
221+ trees= [
220222 gen_random_tree_fixed_size (20 , $ options, nfeatures, T) for i in 1 : ($ ntrees)
221223 ]
222224 )
@@ -240,9 +242,9 @@ function create_utils_benchmark()
240242 check_constraints (tree, $ options, $ options. maxsize)
241243 end ,
242244 setup = (
243- T = Float64;
244- nfeatures = 3 ;
245- trees = [
245+ T= Float64;
246+ nfeatures= 3 ;
247+ trees= [
246248 gen_random_tree_fixed_size (20 , $ options, nfeatures, T) for i in 1 : ($ ntrees)
247249 ]
248250 )
0 commit comments