Skip to content

Introducing new variables in custom loss function #385

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

You must be logged in to vote

Thank you so much for your reply! I only need the radius, where target = target(r) --> the target data points I am trying to fit to is a function of the radius r. Are weights here just any additional free parameters we can use in the loss function besides the target (data points) and prediction (analytic function found by PySR)? If that's the case, then the solution you proposed would work perfectly (sorry I thought weights had some intrinsic definition similar to statistical weights).

Exactly!

They are called "weights" because the standard loss function treats them as regular statistical weightings. But if you are writing a custom loss function anyways, you can use them however you like.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@quasars100
Comment options

@MilesCranmer
Comment options

Answer selected by quasars100
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