Code Monkey home page Code Monkey logo

strong-wrapper's Introduction

strong-wrapper

SMAC is a very powerful tool for optimizing parameters for an algorithm. However, to optimize these parameters you need a good wrapper. This is also discussed in great detail in this article. Essentially, a wrapper with poor performance can make or break the outcome of parameter configuration.

During my 5th semester project where we worked in a group with ant colony optimization I developed this wrapper. The wrapper was developed solely for the purpose of using SMAC alongside our algorithm, and since the wrapper we had before showed poor performance, I named this wrapper "strong-wrapper".

The wrapper is written in python, since it only seemed natural, since the version of SMAC we used was also written in python. If you found this repository then I assume that you are already familiar with SMAC, its use cases, and how to invoke it from the command line.

Preliminaries

If you want to use this wrapper you will have to change a little bit in the code. If you want to use the wall clock limit functionality then you will have to make your algorithm print its results, whenever it finds a new one. Keep in mind, using the wall clock limit is highly algorithm specific, so be careful when using it.

How to use this

Inside tester.py you will find a small example of how it can be used. Our algorithm was written in C++, so that is why we had to call the binary file "routeplanner". If your algorithm is also a binary, then you may do this in a similar fashion, alongside setting static parameters. If your algorithm is written in python you may tweak this code to invoke the algorithm directly, or you may invoke it in a similar fashion using a shebang line in your algorithm.

The set of dynamic parameters are set within strongwrapper.py itself in the commandBuilder function.

The GetScore function may also be overwritten to fit your needs.

When you have made the desired modifications to fit your needs, then you simply invoke the IStrongWrapper.py in the algorithm entry in your SMAC scenario file and you are good to go.

Moving forward

There are a variety of things I would like to change about this code, one of which is increasing modularity and also make the code easier to use, such that less modifications are needed. I will create issues and solve these whenever I have the time. If you run into a problem please do not hesitate to create an issue

strong-wrapper's People

Contributors

imp4l3r avatar

Watchers

 avatar

strong-wrapper's Issues

Interface

The interface IStrongWrapper should be redesigned to handle the parameters that SMAC has to optimize, rather than having them hardcoded into the wrapper itself.

Parameter prefixing should also be handled using this code.
Additionally, adding a file with parameter names also seems neat

Running wrapped algorithm in parallel

In the case where it is needed to run multiple instances during each iteration of SMAC it would be nice to run these in parallel, especially if the algorithm that is being run is only running on a single thread

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.