You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@atharvas this should help simplify LaSR and make it compatible with future versions of SymbolicRegression.jl
Basically the trick is to do the following:
struct LaSROptions{O<:SR.Options} <:SR.AbstractOptions
lm_options::LLMOptions
sr_options::Oendconst LLM_OPTIONS_KEYS =fieldnames(LLMOptions)
@inlinefunction Base.getproperty(options::LaSROptions, k)
if k in LLM_OPTIONS_KEYS
returngetproperty(getfield(options, :lm_options), k)
elsereturngetproperty(getfield(options, :sr_options), k)
endend
Then you can pass any instance of LaSROptions directly to equation_search.
Furthermore, it lets you overload the behavior of any function inside SymbolicRegression.jl that has an input argument options – simply declare a new method for ::LaSROptions.
What do you think?
You can also create a function LaSROptions that checks which keys are in LLMOptions, and uses those to instantiate it, and the other ones to instantiate SR.Options.
This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
A plot of the benchmark results have been uploaded as an artifact to the workflow run for this PR.
Go to "Actions"->"Benchmark a pull request"->[the most recent run]->"Artifacts" (at the bottom).
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@atharvas this should help simplify LaSR and make it compatible with future versions of SymbolicRegression.jl
Basically the trick is to do the following:
Then you can pass any instance of
LaSROptions
directly toequation_search
.Furthermore, it lets you overload the behavior of any function inside SymbolicRegression.jl that has an input argument
options
– simply declare a new method for::LaSROptions
.What do you think?
You can also create a function
LaSROptions
that checks which keys are inLLMOptions
, and uses those to instantiate it, and the other ones to instantiateSR.Options
.