Giter VIP home page Giter VIP logo

mlo's Introduction


#MLO Readme


##About MLO

The optimization of reconfigurable applications often requires substantial effort from the designer who has to analyze the application, create models and benchmarks and subsequently use them to optimize the application. One could try to employ exhaustive search of the application parameter space to carry out optimization yet it is unrealistic since benchmark evaluations involve bit-stream generation and code execution which takes hours of computing time. Recently it has been shown useful to use surrogate models combined with fitness functions for computationally expensive optimization problems in various fields. As these models are orders of magnitude cheaper, they can substantially decrease optimization cost thus allowing for an automated approach. This is the motivation behind Machine Learning Optimizer which we apply to non-linear and multi-modal problem of heterogeneous application parameter optimization. We use regressors to model performance of the design like execution time or throughput, while searching for the global optimum using meta-heuristics. We classify the parameter space using support vector machines to identify designs that would fail constraints; over-map on resources, produce inaccurate results or other.


##Directory Structure


###doc

Contains all of the reports, papers and documentation related to MLO development.


###publications

For each paper published and related to MLO please create a seperate folder containing the relevant LaTeX code. The naming convention for the folder is as follows: conferencename_submissionnumber


###examples

Contains reconfigurable computing fitness function examples. The fitness functions in this directory should be based on well documentated papers, and used for research purpose. Preferably csv files containing the fitness functions and scripts used to obtain this are provided.

Each folder within examples directory contains a fitnes and configuration script. each of the folder contains a small README.txt file refereing to fitness function relevant literature.


###testing

testing contains all of the testing scripts. Currently implementing regression testing.


###views

creates the code of VIEW part of the MVC system. All modes, currently GUI and TERMINAL, reside in this directory. All the possible visualizers are also containted in this directory. All the modes(views) are notified of changes within the model by the controller update method call.

modes.py

script contains the code that starts up relevant mode. Currently either terminal or gui.

gui

folder contains gui code.

gui/windows.py

contains the whole of gui implementation

gui/images

contains images needed to generate gui.

visualizers

folder contains model visuzalization relevant scripts. Visualizers can be used to generate reports, images, plots and others. Currently only plot visuzalizer of the PSOTrial is avaiable (MLOImageViewer).


###controller

Contains code of the controller of the applications. MODEL and VIEW use it to communiate with each other. It also contains code of visualizer, which is used to generate any plots and reports.

controller.py

it is a script used to define top level of the controller. It contains methods to provide comunication between the VIEW and MODEL.

visualizer.py

It is a pool of workers that recieves visualization jobs from the controller/viewer. It recieves a snapshot of the model and a reference to a visualization function. currently it is a multi-threaded process, it could be ported onto a computer cluster.


###model

contains code of the optimization algorithms, runs, trials and surrogate models. It contains code to back them up based on save data.

surrogatemodels

contains code of the avaiable regressors, classifiers and surrogate model frameworks. Currently there are two flavours of GPR available for regression , and one flavour of SVM for classification. Feel free to extend if neccesary.

trials/trial

contains the code of all possible trial types. Other scritps within the trials directory are specific to trial types. Currently only one flavour of MLO is implemented the PSOTrial, which with the GP/SVM surrogate model is the MLO algorithm presented in the FPT'12/ARC'13 papers.

run.py

scripts prepares a bunch of trials of the same type, using a configuration script, and runs them.


###scripts within the directory

optimizer.py

the optimizer initialization script

utils.py

some utility functions used throught the whole application.


##Version convention vA.B.C.


###A

Within a revision starting with number A the fitness and configuration scripts should be compatible.


###B

Minor revisions can introduce changes to the methodology of upkeeping of application state. Before updating a minor revison please ensure that all of the current runs and trials have finished.


###C

Extra features added with no implication on the state of the application.


mlo's People

Contributors

friedsock avatar icltc avatar mk306 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

mlo's Issues

Finally I got my Mac work for mlo

LOL, as the title says, I won the battle.......it tooks me 2 weeks... finally it turn out to be a simplest way for getting over...

It's a long long battle for me to get the mac work for mlo, I think it is because the complicated structure in Mac os in terms of the preinstalled python and the user installed one. I'd like to share a few issues of that...

  1. the first is the wxpython, I find two version of wxpython in the download page: wxPython2.9-osx-docs-demos-carbon-py2.7
    wxPython2.9-osx-docs-demos-cocoa-py2.7
    I random picked the first one... it didn't work... come on... I uninstalled it... and installed again, the same wrong message... I have no idea... it is just a package....why... finally I got the answer from Milan (Thank you very much, you saved me...), he said make sure install the version of cocoa... Thanks God...
  2. the numpy is incompatible to preinstalled python in Mac, that's tricky... I still wondering why.... it turn out to a waste of my whole 2 days for settle this....
  3. when I installed a new python and got the new numpy-1.8.0, scipy-0.12.0... packages work for the python, then I run the mlo, it reports "unable to import numpy.array.multiarray" ... I check the website, there are a few but none of them successful settle this... I lost again, then I find one says it probably because the wrong version of the numpy, then I opened the terminal and typed numpy.version.version, numpy-1.6.1.....OMG...what hell is that...where it come from... I deleted my numpy again and reinstalled, still the same... I got angry about that, I searched the whole file system with name of numpy-1.6.1... I found .... it is from system installed python...O M G, why I use user installed python, it import the package from system installed python... I "rm -rf" it...it disappeared... I opened the terminal again and type numpy.version.version, turn out to be 1.6.1...."F....word", I was astonished, I search the whole computer with numpy 1.6.1 again.... nothing... so what I met... Ghost???? I abandoned it... got a 10 minutes break, watched a football game bt Manchester City and Liverpool, I saw the player falling down on the ground and got up quickly... that's a man... Why I gave up so easily. I opened the terminal again, and search numpy-1.6... I found nothing but 1.6.2, I type python and then import numpy then numpy.version( this time I want to see where this version file came from), I found it, I found it, it is again from system installed.... OMG, I deleted it quickly.... and type numpy.version.version... I cried....it prints 1.8.0, that's exactly I want, then I run the mlo, works.......

that's a long long battle, mac os kills me....but I survived...

I put an issue here and hope everybody else who want to use Mac for MLO see this issue before start....

Yours,
Tianchi

to run the program by sudo

when I ran the program in the first time, it reported this:
File "/home/kyah/MLO-master/model/trials/trial.py", line 91, in initialise
results_folder, images_folder = self.create_results_folder()

ValueError: too many values to unpack

when I found the code in the find and add a return value to this function, it turned out a new error message
File "/home/kyah/MLO-master/model/run.py", line 110, in save_run_data
with open(self.results_folder_path + '/run_data.txt', 'w') as run_data:

IOError: [Errno 2] No such file or directory: '/data/log/2013-01-31_22-38-41/run_data.txt'

then I try sudo sh run_mlo,sh, it works....
I believe it's because it cannot create a folder without a sudo

New application architecture.

Create trial specific viewers :) That the way it really supposed to be happening...

1.Redefine trial...

  • PSOTrial should contain the current run method call
  • Trials should be more generic, so that they could include other sort of optimization loops
  • PSOTrial should be of class Trial
  • 2.Printer classes should specify the printing behaviour
    examples:
    • printing to html
    • printing to terminal
    • printing to gui
    • printing to csv
    • printing to pdf
      3.

ctrl+c... and join(timeout...)

Well the way we currently implement ctrl+c handling is by using daemon flag on threads and join(timeout) insead of timeout... not very elegant )

run

loading an old run will always regenerate the image for the last generation... fix that somehow. Also check why GP always fails for the first image

crash on the GUI & Non-GUI in Windows

the GUI run in Windows is wrong with buttons and views like this
0ZUMWY F5OY6U24PL I L
and when I choosed the scripts and run, the view changed to this
 ECCR AKEA BWMA2_B2DE, however it still doesn't work with the thread error
C7OPVFKCKKV B 1G3 F5 8I

polish off gui and architecture (option windows mainly)

1.graph specification mechanism should be updated to include different visualizers for different trial types ( not used currently)
2.add possibility in options to change graph generation range. Regenerating images within a range of the main iterator ( generations usually).

Add regression testing

1.Add regression testing features to the application... Figure out what and how should be checked. Cant really check gui.

Change Trial Loading mechanism

1.Use Snapshot function to save/load state
2.By doing so, create a smart Trial/Run OO structure... have to make extensions easier.

  • define Trial abstract class
  • define MLO abstract class inhering from TRIAL
  • define MLO flavours..

Rework the image regeneration..

1.left and right button should work differently.
2.need to add "regenerate all" button to graphs view.
3.fix pso image generation.. we dont want the particle path to be visualized! just there current position
4.Define extra counter during image generation... currently almost nothing is there

GUI enhancment

1.Add counter value to the generated images. Current generation, number of fitness functions evaluated should be standard thing.

2.In the main trail window.. add a column to the right of start time containing predicted time left.

3.In terminal mode, add extra printouts. Will update on it.. (Need some info on the models state).

  • the terminal printer should mainly consist of generating a surrogate model/run report... How many runs have finished... how long it has been running... how much it has got left etc. Please use trial snapshot function. Talk to me about modifying the MVC structure to make this bit easier.
  • I would suggest creating report.py in visualizers directory. It should print pdf/jpg/html files or whatever user wants (give some options... containing an extensive report on the algorithm.

4.Create a Run -> Trial hierarchy. The current window contains all trials. The main window should contain all runs, which later on should contain all runs. Runs and Trials should have different viewers (associated with their type). Please discuss this with me.

GaussianProcessRegression train fails if there are too few training examples./

This problem becomes prominent when using a classifier, and there are not enough training examples for the regressor... Probably should investigate all the possible cases when regression fails, and what to do :) Active learning kick in.

Traceback (most recent call last):
File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
self._target(_self._args, *_self._kwargs)
File "/data/MLO/regressors.py", line 137, in fit_data
gp.fit(scaled_training_set, adjusted_training_fitness)
File "/usr/local/lib/python2.7/dist-packages/scikit_learn-0.11-py2.7-linux-x86_64.egg/sklearn/gaussian_process/gaussian_process.py", line 315, in fit
+ "regression model size p=%d.") % (n_samples, p))
Exception: Ordinary least squares problem is undetermined n_samples=5 must be greater than the regression model size p=6.

i guess its only for square regressors

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.