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

In script evolution.py, some code is incomplete. Can you provide the complete code? #5

Open
Xingyuxingyu opened this issue Sep 14, 2024 · 2 comments

Comments

@Xingyuxingyu
Copy link

Hi,

Thank you very much for your work and open source code. However, I found some of the code in script evolution.py that wasn't complete. For example, 'update_top_k' function was not implemented, 'self.keep_top_k[self.select_num]' was empty and 'cand = choice(self.keep_top_k[k])' raised an error . I am not sure if there's anything else to add. It takes a long time to run it again and report an error.
error

I really hope that you can provide a complete code that can run the results, thank you very much!

@hoangvictor
Copy link

@Xingyuxingyu I think this method could be defined like this:

def update_top_k(self, candidates, k, key):
        sorted_candidates = sorted(candidates, key=key)
        top_k_candidates = sorted_candidates[:k]
        self.keep_top_k[k] = top_k_candidates

The idea here is to select the top k candidates and perform mutation and crossover operations on them.

@Xingyuxingyu
Copy link
Author

Xingyuxingyu commented Oct 31, 2024 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