GithubHelp home page GithubHelp logo

cfdg-optimizer's Introduction

CFDG Optimizer: An optimization tool for improving CFDG grammar files.

CFDG grammar files are shape grammar files created for the Context Free program.

This tool will adjust the rule probabilities of CFDG grammars to produce output that most closely matches a list of example images that you provide.

Installing cfdg-optimizer

On Debian Linux:

sudo apt-get install gfortran libopenblas-dev liblapack-dev
pip install cfdg-optimizer

Now you should be able to use cfdg-optimizer using the cfdgo command.

Using cfdg-optimizer

You must have:

  • An existing CFDG grammar file
  • A directory of images that you want your grammar to closely produce

Let's suppose the grammar file is called grammar.cfdg and the images directory is called testimages/.

  1. Open your grammar file for editing.

  2. Add a wildcard ('*') to every rule whose rule probability you want modified. If the rule has a probability, this wildcard goes between the rule name and the probability value. Otherwise, the wildcard should go after the rule name. For example:

    rule examplerule             --->  rule examplerule *
    rule anotherexamplerule 1.5  --->  rule anotherexamplerule * 1.5
    
  3. Run the cfdgo command like so:

cfdgo grammar.cfdg /path/to/testimages/
  1. cfdg-optimizer should calculate the optimal probabilities for the rules that you marked for modification. When done, it will return the optimial grammar variant in its own file.

cfdg-optimizer's People

Contributors

jaycaz avatar

Watchers

James Cloos avatar  avatar

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.