Git Product home page Git Product logo

sigs-grid-search's Introduction

Intro

This script will help you run grid search on any python script.

Dependencies

multiprocessing, numpy, csv

File structure

Your code should include the following elements:

  1. A main file which accepts arguments with argparse. Let's call is main.py.
  2. A function to compile the data returned by main.py, let's call it compile_func. This function should be able to take the data points iteratively. You'd have to call this from main.py. A simple function called is already provided and can be imported as from grid_search import insert_to_csv.

Instructions

It it best to open dummy_run.py as the library is quite intuitive and simple to run. You can use this file as your template.

  1. Import the library from grid_search import GridSearch
  2. Set name of main file, main_file = 'dummy_main.py'
  3. Create a function for compiling result. I am importing the compile_csv function from grid_search. I am calling this from within my dummy_main.py file which saves the result of every run in a csv file.
  4. Define arguments for running grid search:
    1. For every parameter you'd need one key containing it's name
    2. Each key can either be a list of all values of that parameter
    3. Or each key can be a dictionary with keys {'min', 'max', 'num', 'scale'} if you wish to uniformly choose values in a range. 'scale' can be 'linear' or 'log'. For log scale 'min' and 'max' should be the powers of 10. Eg. for 1e-1 to 1e3, 'min'=-1 and 'max'=3
  5. Create an object of GridSearch. myGridSearch = GridSearch(main_file, compile_func, args, num_process=2)
  6. Run grid search with myGridSearch.run()

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.