pyocl / openclga Goto Github PK
View Code? Open in Web Editor NEWA Python Library for Genetic Algorithm on OpenCL
License: MIT License
A Python Library for Genetic Algorithm on OpenCL
License: MIT License
Exception ignored in: <bound method Image.__del__ of <tkinter.PhotoImage object at 0x000001FA57641668>>
Traceback (most recent call last):
File "D:\Program Files\Python35\lib\tkinter\__init__.py", line 3356, in __del__
self.tk.call('image', 'delete', self.name)
RuntimeError: main thread is not in main loop
Tcl_AsyncDelete: async handler deleted by the wrong thread
We'd like to have a 2nd optimization algorithm to strengthen the ability of this module.
[server_loop] TaskThread : start executing ... task (1)
[httpwsserver] TaskThread : running ...
[INFO] Http server is created @ port 8000.
adding task(2) to ...[httpwsserver]
[httpwsserver] TaskThread : start executing ... task (2)
Press prepare + <Enter> to prepare
Press run + <Enter> to run
Press restore + <Enter> to restore
Press pause + <Enter> to pause
Press save + <Enter> to save (filename:test%d%d.pickle)
Press stop + <Enter> to stop
Press get_st + <Enter> to get statistics
Press get_best + <Enter> to get best
Press ctrl + c to exit
trying to access /Users/hchu/git/python/oclGA/OpenCLGA/ui
127.0.0.1 - - [13/May/2017 23:19:11] "GET / HTTP/1.1" 200 -
trying to access /Users/hchu/git/python/oclGA/OpenCLGA/ui/static/js/main.c1e1ba0d.js
trying to access /Users/hchu/git/python/oclGA/OpenCLGA/ui/static/css/main.5da4bf40.css
127.0.0.1 - - [13/May/2017 23:19:11] "GET /static/js/main.c1e1ba0d.js HTTP/1.1" 200 -
127.0.0.1 - - [13/May/2017 23:19:11] "GET /static/css/main.5da4bf40.css HTTP/1.1" 200 -
127.0.0.1 - - [13/May/2017 23:19:12] "GET / HTTP/1.1" 101 -
127.0.0.1 - - [13/May/2017 23:19:12] websocket connected
[INFO] WS Controller ('127.0.0.1', 52757) is on !!
trying to access /Users/hchu/git/python/oclGA/OpenCLGA/ui/favicon-16x16.png
127.0.0.1 - - [13/May/2017 23:19:12] "GET /favicon-16x16.png HTTP/1.1" 200 -
trying to access /Users/hchu/git/python/oclGA/OpenCLGA/ui/favicon-96x96.png
127.0.0.1 - - [13/May/2017 23:19:12] "GET /favicon-96x96.png HTTP/1.1" 200 -
trying to access /Users/hchu/git/python/oclGA/OpenCLGA/ui/favicon-32x32.png
127.0.0.1 - - [13/May/2017 23:19:12] "GET /favicon-32x32.png HTTP/1.1" 200 -
trying to access /Users/hchu/git/python/oclGA/OpenCLGA/ui/android-icon-192x192.png
127.0.0.1 - - [13/May/2017 23:19:12] "GET /android-icon-192x192.png HTTP/1.1" 200 -
[('127.0.0.1', 52775)] Connected !
[('127.0.0.1', 52776)] Connected !
[INFO] Send to Controller : {'type': 'workerConnected', 'data': {'type': 'CPU', 'platform': 'Apple', 'name': 'Intel(R) Core(TM) i7-3540M CPU @ 3.00GHz', 'ip': '127.0.0.1', 'worker': '988169d037ef11e784f0542696d3ed23'}}
[INFO] Send to Controller : {'type': 'workerConnected', 'data': {'type': 'GPU', 'platform': 'Apple', 'name': 'HD Graphics 4000', 'ip': '127.0.0.1', 'worker': '9882e29c37ef11e78dab542696d3ed23'}}
[('127.0.0.1', 52786)] Connected !
[INFO] Send to Controller : {'type': 'workerConnected', 'data': {'type': 'CPU', 'platform': 'Apple', 'name': 'Intel(R) Core(TM) i7-3540M CPU @ 3.00GHz', 'ip': '127.0.0.1', 'worker': 'b2ea153837ef11e79efa542696d3ed23'}}
[('127.0.0.1', 52796)] Connected !
[INFO] Send to Controller : {'type': 'workerConnected', 'data': {'type': 'CPU', 'platform': 'Apple', 'name': 'Intel(R) Core(TM) i7-3540M CPU @ 3.00GHz', 'ip': '127.0.0.1', 'worker': 'c6bff50037ef11e7a961542696d3ed23'}}
trying to access /Users/hchu/git/python/oclGA/OpenCLGA/ui/static/js/main.c1e1ba0d.js.map
127.0.0.1 - - [13/May/2017 23:21:10] "GET /static/js/main.c1e1ba0d.js.map HTTP/1.1" 200 -
trying to access /Users/hchu/git/python/oclGA/OpenCLGA/ui/static/css/main.5da4bf40.css.map
127.0.0.1 - - [13/May/2017 23:21:10] "GET /static/css/main.5da4bf40.css.map HTTP/1.1" 200 -
trying to access /Users/hchu/git/python/oclGA/OpenCLGA/ui
127.0.0.1 - - [13/May/2017 23:21:33] "GET / HTTP/1.1" 200 -
[INFO] WS Controller is off, clean up all websockets !!
127.0.0.1 - - [13/May/2017 23:21:33] websocket closed
127.0.0.1 - - [13/May/2017 23:21:34] "GET / HTTP/1.1" 101 -
127.0.0.1 - - [13/May/2017 23:21:34] websocket connected
[INFO] WS Controller ('127.0.0.1', 52906) is on !!
[INFO] Send to Controller : {'type': 'workerConnected', 'data': {'type': 'CPU', 'platform': 'Apple', 'name': 'Intel(R) Core(TM) i7-3540M CPU @ 3.00GHz', 'ip': '127.0.0.1', 'worker': '988169d037ef11e784f0542696d3ed23'}}
[INFO] Send to Controller : {'type': 'workerConnected', 'data': {'type': 'GPU', 'platform': 'Apple', 'name': 'HD Graphics 4000', 'ip': '127.0.0.1', 'worker': '9882e29c37ef11e78dab542696d3ed23'}}
[INFO] Send to Controller : {'type': 'workerConnected', 'data': {'type': 'CPU', 'platform': 'Apple', 'name': 'Intel(R) Core(TM) i7-3540M CPU @ 3.00GHz', 'ip': '127.0.0.1', 'worker': 'b2ea153837ef11e79efa542696d3ed23'}}
[INFO] Send to Controller : {'type': 'workerConnected', 'data': {'type': 'CPU', 'platform': 'Apple', 'name': 'Intel(R) Core(TM) i7-3540M CPU @ 3.00GHz', 'ip': '127.0.0.1', 'worker': 'c6bff50037ef11e7a961542696d3ed23'}}
We use main-thread to handle all messages from websocket. It would be nice to handle the data at batch. Because the message from web worker may be too fast that a redux cannot handle it with clone or immutable structure. We can aggregate some of them and process them in a batch.
As a user, I would like to see the performance of each generation. It would be ok to see it at console. But it would be great to see it as a GUI chart.
As a user, I would like to specify the web server of ocl_ga_server to populate the web client I want to populate.
We should evaluate py2opencl and help it to be compatible with python 3
It looks like the reducer cannot handle a lot of data... The possible solutions may be 1. move data cloning, aggregation, comparison to another thread, 2. use a time interval for batch data processing.
as a user, I would like to share top N chromosomes among all devices to boost the performance.
Hello,
This is an interesting project. Some questions:
How PyOpenCL compatible with NVidia Card ?
Is the objective function "converted/implemented" on the GPU side (evaluation is done on GPU) ?
Thanks, regards
As a user of UI, we should block the connection when websocket is connected by one UI to prevent other users uses the server.
Provide an implementation in python.
As a user, I would like to connect all of my devices to run a single GA model.
We could improve it in some parts.
As a user, I would like to extinct some chromosomes if they are too similar to each other.
We shouldn't accept more connections when UI dispatches a prepare command because we cannot run, pause, stop any clients if they didn't prepared.
We can accept more connection when the server is created or all clients are stopped. In the client stopped, we can recycle the client by prepare them again....
As a user, I would like to have multiple web console to see the results. Only one can be the controller and others are viewer.
Since kilik had a remote device execution lib, we can leverage it to run oclGA among all of our devices to see who fast/best we can have.
To support mulit-types of genes
TSP is a problem name not a good name for GA. We should replace it with another name.
I would suggest:
These information should be independent from chromosome.
Should consider it as a list or dictionary, so that we could track the top N best chromosomes, or the bottom M worst chromosomes.
don't know why....
We're append data to sendq in A thread but consuming sendq in B thread.
Even further, now we check the length of sendq to decide if the socket is ok to be closed.
We should make it thread-safe.
As a user, I would like to know if this project is robust enough...
According to the proposal 1 and 2, we should generate some PIs or codes on the fly. This part is doable. But we need to evaluate if we can cast __global variable into what we want....
This issue is just for evaluation, no need to commit any code.
As a user, I would like to pause the execution of GA for closing my computer and find a good time to resume the execution of GA.
As a user, I would like to terminate the calculation if one the following cases:
Currently, we use TSP as an example which tries to minimize the path. This doesn't follow the convention of GA. GA tries maximize the fitness value. We should reverse our implementation to follow the convention of GA.
it's time to write docs more than codes.
The README.md still use TSP. We should rename them...
We should move the UI as a standalone repo and put the production code at ui folder.
as a contributor, I would like to run the test cases before contributing my code to repo for preventing breaks.
Some functions at utils do the generic things, like custom_crossover does non-repeatable element cross over. We should rename all of them to reflect their intrinsic.
kilik had found a way to define preprocessor definition at python, see #9 .
size = 100
clProg = cl.Program(ctx, fstr).build(options="-D GLOBAL_SIZE={0}".format(size))
Currently, we use code generation to put all preprocessor definitions. If possible, we should use build options to do so. I cannot make sure how long it can use or any limitation at that.
as a user, I would like to use python setup.py to install all dependencies and download it through pip...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.