Skip to content

Evaluate objective in C#366

Open
HenrikMettler wants to merge 15 commits intoHappy-Algorithms-League:masterfrom
HenrikMettler:dev/evaluate_in_c
Open

Evaluate objective in C#366
HenrikMettler wants to merge 15 commits intoHappy-Algorithms-League:masterfrom
HenrikMettler:dev/evaluate_in_c

Conversation

@HenrikMettler
Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread cgp/cartesian_graph.py Outdated
Comment thread cgp/cartesian_graph.py Outdated
Comment thread cgp/cartesian_graph.py Outdated
Comment thread cgp/cartesian_graph.py
Comment thread cgp/cartesian_graph.py Outdated
Comment on lines +461 to +462
"function_name can not be substring of filename, due to function declaration"
"consistency checks"
Copy link
Copy Markdown
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
Copy Markdown
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?

Comment thread examples/example_evaluate_in_c.py Outdated
Comment thread examples/example_evaluate_in_c.py Outdated
Comment thread examples/example_evaluate_in_c.py Outdated
Comment thread examples/example_evaluate_in_c.py Outdated
Comment thread examples/example_evaluate_in_c.py
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