How to implement customized initialization of population? #491
-
Hi all, I am implementing a custom project and have found the library very helpful. How can I set up a customized initialization population to trigger symbol regression? Thanks in advance. Jay |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi Jay, The current code for initializing the population of expressions is here: Right now it calls 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 SymbolicRegression.jl so you can use Revise.jl for quickly changing things). Cheers, |
Beta Was this translation helpful? Give feedback.
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 appendingnlength
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…