Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature : Custom cost function #45

Closed
arita37 opened this issue Aug 19, 2022 · 3 comments
Closed

Feature : Custom cost function #45

arita37 opened this issue Aug 19, 2022 · 3 comments

Comments

@arita37
Copy link

arita37 commented Aug 19, 2022

Hello,

Just wondering, how we can use custom cost function ?

def mycost(formuale_str)  : 


   cost = myfun( eval(formulae_str)  ,....)

    return cost

For many problems, cost is very customized.

@brendenpetersen
Copy link
Collaborator

You can create your own custom Task, which could be an entirely different search space and/or reward function.

In your case, if you want to keep the search space (assuming mathematical expressions based on your snippet above) then it's probably easiest to subclass the RegressionTask and overwrite reward_function. Or just change reward_function locally if you don't care about upstream changes.

@brendenpetersen
Copy link
Collaborator

#43 also relevant

@arita37
Copy link
Author

arita37 commented Aug 20, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants