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

Evaluate objective in C #366

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

HenrikMettler
Copy link
Contributor

For some applications, one might want to evaluate fitness in C. Here CartesianGraph is extended with a function to_c which writes the computational graph into a C-module. An example is provided which performs L2 regression on a simple target function.
Note: Due to a late api change (writing files instead of returning strings) the test is currently not working - I left it as commented out code since large junks of it should be reusable with reading from generated files

@HenrikMettler HenrikMettler requested a review from jakobj May 25, 2022 17:13
@jakobj jakobj added the examples Showcasing the library label May 31, 2022
@jakobj jakobj added this to the 0.4.0 milestone May 31, 2022
Copy link
Member

@jakobj jakobj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome, great work @HenrikMettler!!1 🚀

i left a couple of comments that should be addressed before merging.

cgp/cartesian_graph.py Outdated Show resolved Hide resolved
cgp/cartesian_graph.py Outdated Show resolved Hide resolved
cgp/cartesian_graph.py Outdated Show resolved Hide resolved
cgp/cartesian_graph.py Show resolved Hide resolved
Comment on lines 461 to 462
"function_name can not be substring of filename, due to function declaration"
"consistency checks"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"function_name can not be substring of filename, due to function declaration"
"consistency checks"
"function_name can not be substring of filename"

maybe just shorten to this, since it's anyway hard to understand

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at this again, maybe it is easiest to just remove the ability to set function_name and filename? Then we don't have to worry about this check?

examples/example_evaluate_in_c.py Outdated Show resolved Hide resolved
examples/example_evaluate_in_c.py Outdated Show resolved Hide resolved
examples/example_evaluate_in_c.py Outdated Show resolved Hide resolved
examples/example_evaluate_in_c.py Outdated Show resolved Hide resolved
examples/example_evaluate_in_c.py Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
examples Showcasing the library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants