Skip to content

Commit

Permalink
feat!: modify default hyperparameters
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesCranmer committed Oct 27, 2024
1 parent 72d86ab commit 4caca7d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 26 deletions.
51 changes: 27 additions & 24 deletions src/Options.jl
Original file line number Diff line number Diff line change
Expand Up @@ -971,44 +971,47 @@ function default_options(@nospecialize(version::Union{VersionNumber,Nothing} = n
else
return (;
# Creating the Search Space
binary_operators=[+, -, /, *],
binary_operators=Function[+, -, /, *],
unary_operators=Function[],
maxsize=30,
# Setting the Search Size
populations=86,
population_size=57,
ncycles_per_iteration=364,
populations=31,
population_size=27,
ncycles_per_iteration=380,
# Working with Complexities
parsimony=0.0,
warmup_maxsize_by=0.0,
adaptive_parsimony_scaling=148,
adaptive_parsimony_scaling=1040,
# Mutations
mutation_weights=MutationWeights(;
mutate_constant=0.0353,
mutate_operator=3.63,
swap_operands=0.00608,
rotate_tree=1.42,
add_node=0.0771,
insert_node=2.44,
delete_node=0.369,
simplify=0.00148,
randomize=0.00695,
do_nothing=0.431,
mutate_constant=0.0346,
mutate_operator=0.293,
swap_operands=0.198,
rotate_tree=4.26,
add_node=2.47,
insert_node=0.0112,
delete_node=0.870,
simplify=0.00209,
randomize=0.000502,
do_nothing=0.273,
optimize=0.0,
form_connection=0.5,
break_connection=0.1,
),
crossover_probability=0.0611,
annealing=false,
alpha=0.1,
perturbation_factor=0.219,
probability_negate_constant=0.000834,
crossover_probability=0.0259,
annealing=true,
alpha=3.17,
perturbation_factor=0.129,
probability_negate_constant=0.00743,
# Tournament Selection
tournament_selection_n=49,
tournament_selection_p=0.509,
tournament_selection_n=15,
tournament_selection_p=0.982,
# Migration between Populations
fraction_replaced=0.000186,
fraction_replaced_hof=0.487,
fraction_replaced=0.00036,
## ^Note: the optimal value found was 0.00000425,
## but I thought this was a symptom of doing the sweep on such
## a small problem, so I increased it to the older value of 0.00036
fraction_replaced_hof=0.0614,
topn=12,
# Performance and Parallelization
batching=false,
Expand Down
4 changes: 2 additions & 2 deletions src/SymbolicRegression.jl
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ which is useful for debugging and profiling.
- `y::Union{AbstractMatrix{T}, AbstractVector{T}}`: The values to predict. The first dimension
is the output feature to predict with each equation, and the
second dimension is rows.
- `niterations::Int=10`: The number of iterations to perform the search.
- `niterations::Int=100`: The number of iterations to perform the search.
More iterations will improve the results.
- `weights::Union{AbstractMatrix{T}, AbstractVector{T}, Nothing}=nothing`: Optionally
weight the loss for each `y` by this value (same shape as `y`).
Expand Down Expand Up @@ -419,7 +419,7 @@ which is useful for debugging and profiling.
function equation_search(
X::AbstractMatrix{T},
y::AbstractMatrix;
niterations::Int=50,
niterations::Int=100,
weights::Union{AbstractMatrix{T},AbstractVector{T},Nothing}=nothing,
options::AbstractOptions=Options(),
variable_names::Union{AbstractVector{String},Nothing}=nothing,
Expand Down

0 comments on commit 4caca7d

Please sign in to comment.