Skip to content

Coevolution with simultaneous function evaluation #527

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

You must be logged in to vote

Hi @bengcohen,

Thanks and cool idea. I think you could do this with a custom objective that creates that specific structure, like this example: https://astroautomata.com/PySR/examples/#9-custom-objectives.

e.g., say that you set the last column of X to be all 0. You can put y0 into that column during the evaluation.

tree.degree != 2 && return L(1e10)

# Split the tree at the root node
f0 = tree.l
f1 = tree.r

y0, flag0 = eval_tree_array(f0, dataset.X, options)
!flag0 && return L(1e9)  # Return a bit lower loss for this breakpoint, because at least it got this far

modified_X = copy(dataset.X)
modified_X[end, :] .= y0  # Set last column to y0

y1, flag1 = eval_tree_array(f1, modified_X, op…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@bengcohen
Comment options

@MilesCranmer
Comment options

@bengcohen
Comment options

@MilesCranmer
Comment options

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