Skip to content

How to implement customized initialization of population? #491

Answered by MilesCranmer
csjtx1021 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi Jay,

The current code for initializing the population of expressions is here:

https://github.com/MilesCranmer/SymbolicRegression.jl/blob/f38ea0df4c362cd52d0cc2034c358c0b11474697/src/Population.jl#L37-L63

Right now it calls gen_random_tree(nlength, options, nfeatures, T) which is basically appending nlength random nodes to a root node. The code for that method is here: https://github.com/MilesCranmer/SymbolicRegression.jl/blob/f38ea0df4c362cd52d0cc2034c358c0b11474697/src/MutationFunctions.jl#L228-L238.

If you're using PySR (?) you can see https://astroautomata.com/PySR/backend/ for customizing the backend and implementing custom behavior. (But it's probably easier to start directly with…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@csjtx1021
Comment options

Answer selected by csjtx1021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
SymbolicRegression.jl SymbolicRegression.jl-related discussion
2 participants