MilesCranmer commited on
Commit
eebd675
1 Parent(s): 4b7293a

Allow verbosity=0 to turn off hall of fame printing

Browse files
Files changed (1) hide show
  1. julia/sr.jl +11 -7
julia/sr.jl CHANGED
@@ -1217,15 +1217,17 @@ function fullRun(niterations::Integer;
1217
  deleteat!(equation_speed, 1)
1218
  end
1219
  average_speed = sum(equation_speed)/length(equation_speed)
1220
- @printf("\n")
1221
- @printf("Cycles per second: %.3e\n", round(average_speed, sigdigits=3))
1222
- @printf("Hall of Fame:\n")
1223
- @printf("-----------------------------------------\n")
1224
- @printf("%-10s %-8s %-8s %-8s\n", "Complexity", "MSE", "Score", "Equation")
1225
  curMSE = baselineMSE
1226
- @printf("%-10d %-8.3e %-8.3e %-.f\n", 0, curMSE, 0f0, avgy)
1227
  lastMSE = curMSE
1228
  lastComplexity = 0
 
 
 
 
 
 
 
 
1229
 
1230
  for size=1:actualMaxsize
1231
  if hallOfFame.exists[size]
@@ -1251,7 +1253,9 @@ function fullRun(niterations::Integer;
1251
  delta_c = size - lastComplexity
1252
  delta_l_mse = log(curMSE/lastMSE)
1253
  score = convert(Float32, -delta_l_mse/delta_c)
1254
- @printf("%-10d %-8.3e %-8.3e %-s\n" , size, curMSE, score, stringTree(member.tree))
 
 
1255
  lastMSE = curMSE
1256
  lastComplexity = size
1257
  end
 
1217
  deleteat!(equation_speed, 1)
1218
  end
1219
  average_speed = sum(equation_speed)/length(equation_speed)
 
 
 
 
 
1220
  curMSE = baselineMSE
 
1221
  lastMSE = curMSE
1222
  lastComplexity = 0
1223
+ if verbosity > 0
1224
+ @printf("\n")
1225
+ @printf("Cycles per second: %.3e\n", round(average_speed, sigdigits=3))
1226
+ @printf("Hall of Fame:\n")
1227
+ @printf("-----------------------------------------\n")
1228
+ @printf("%-10s %-8s %-8s %-8s\n", "Complexity", "MSE", "Score", "Equation")
1229
+ @printf("%-10d %-8.3e %-8.3e %-.f\n", 0, curMSE, 0f0, avgy)
1230
+ end
1231
 
1232
  for size=1:actualMaxsize
1233
  if hallOfFame.exists[size]
 
1253
  delta_c = size - lastComplexity
1254
  delta_l_mse = log(curMSE/lastMSE)
1255
  score = convert(Float32, -delta_l_mse/delta_c)
1256
+ if verbosity > 0
1257
+ @printf("%-10d %-8.3e %-8.3e %-s\n" , size, curMSE, score, stringTree(member.tree))
1258
+ end
1259
  lastMSE = curMSE
1260
  lastComplexity = size
1261
  end