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

[meta] generalize tsp_cl_algo as a GA algorithm #2

Closed
7 tasks done
john-hu opened this issue Nov 3, 2016 · 5 comments
Closed
7 tasks done

[meta] generalize tsp_cl_algo as a GA algorithm #2

john-hu opened this issue Nov 3, 2016 · 5 comments
Assignees
Labels

Comments

@john-hu
Copy link
Member

john-hu commented Nov 3, 2016

  • separate crossover, mutation, fitness as three files
  • implement non-repeatable crossover
  • implement non-repeatable mutation
  • implement repeatable crossover
  • implement repeatable mutation
  • generate gene/chromosome struct according to gene.py and chromoosome.py
  • generate kernel entry function according to properties of algorithm.py.
    • crossover function,
    • mutation function, etc
@kilikkuo
Copy link
Contributor

As far as I can think of ... 2 thing should be taken into account.

  1. To support general poinit mutation (allow duplicated element inside a gene), a list of possible elements of a gene should be passed into OCL kernel. ==> Should not be a big problem.
  2. The dna length of a gene is able to greater than 1, that is, are we gonna support genes with variable length ?
    I don't think it's a easy task. IMO, it's quite tough. We may need to create a 2-D array of chromosomes in OCL Kernel to make it easy for crossover. We may need extra array to deliver the length of each chromosome (or even gene).
    If we're not gonna support. Then user need to think of a way, e.g. fill additional 0 into a gene's dna sequence to make every gene equal in length.

Thoughts ?

@john-hu
Copy link
Member Author

john-hu commented Nov 28, 2016

https://github.com/PyOCL/oclGA/wiki/Proposal-of-OpenCL-GA

To support general poinit mutation (allow duplicated element inside a gene), a list of possible elements of a gene should be passed into OCL kernel. ==> Should not be a big problem.

In my design, it can be passed through the source code generation. You give me a good hint that the data will be put at stack if I put the data in source code. And if we pass data through function call, the data will be in heap. That should be better....

The dna length of a gene is able to greater than 1, that is, are we gonna support genes with variable length ?

This is a nice catch. I don't think we need to implement it now. It's called GP if we have variable length gene. It is important and we need to implement it in the future. BTW, in my design, we can implement different Gene in both python and CL to support it.

I don't think it's a easy task. IMO, it's quite tough. We may need to create a 2-D array of chromosomes in OCL Kernel to make it easy for crossover. We may need extra array to deliver the length of each chromosome (or even gene).

This one is also a good point. I cannot find any use case now. And it is worth to have further discussion.

If we're not gonna support. Then user need to think of a way, e.g. fill additional 0 into a gene's dna sequence to make every gene equal in length.

I don't think so. We can fill a lot of 0 in python for user If we really need to say oclGA supports it.

@john-hu
Copy link
Member Author

john-hu commented Dec 9, 2016

An example implementation of my proposal can be found here: https://github.com/PyOCL/oclGA/tree/1e2e0be35e66ecd08a5caaa882f73be886354783/evaluation/oclGA

@john-hu
Copy link
Member Author

john-hu commented Dec 9, 2016

As per offline discussion, we found the implementation of crossover or mutation doesn't give us good solution. There are few docs for this topic here:

@john-hu
Copy link
Member Author

john-hu commented Dec 27, 2016

The first version of oclGA is implemented at evaluation folder. I close this issue and file another for moving the code to root.

@john-hu john-hu closed this as completed Dec 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants