Git Product home page Git Product logo

grid_generation's Introduction

Grid_Generator

Grid Generator is a tool for creating optimal Pictogram Grid Communication Systems, written by Carlos Vargas and supervised by Didier Schwab, Phd. It was originally designed as a Jupyter Notebook but was eventually adapted as a python script. It is a framework that allows to read, modify and evaluate pictogram grids and implements a Machine Learning algorithm (genetic algorithm) to find the best performing grids. The metric used to evaluate the grids is the cost of producing a sentence given as input. This metric as well as the code to compute the distance between each pictogram within a grid were designed in another project. This code has been improved and adapted to our particular needs.

For more technical information, consult the documentation.

Installation

You need to have installed a recent version of python (3.x). To install the other dependencies, you can run the install_all.sh file in your console, assuming you are in the same directory as the requirements.txt file.

./install_all.sh

You can also check out the specific dependencies in requirements.txt

Usage

To launch the program, you can use the next command signature in your console:

python gridGenerator.py [-f SOURCES_LIST] [-s SENTENCE] [-nl NB_LINES] [-nc NB_COLS] [-th THRESHOLD] [-mi MAX_ITER]

To get extra information about the meaning of each argument, you can use the '--help' flag:

python gridGenerator.py --help

Documentation

The documentation is available here.

Known bugs

  • The function Grid.shuffle(), which recombines all the pictograms within a page, is generating an error when launched in the genetic algorithm sequence. This error is produced by the wrong update of the attributes' dictionary of the grid, which causes that several pictograms are assigned to the same position on the same page, exceeding the maximum capacity of the page.

    For this reason, this functionality was disabled and is not currently used in the program. However, the code is available in the main script for further revision.

  • The computed production cost given by the algorithm is not exactly the same as if one calculates it by hand using the output path, but it is a good approximation of the real value.

  • In some cases, the algorithm that computes the optimal path seems unable to recognize a pictogram (usually those having a destination page), this ends up in wrong path computation.

Testing et Debugging

For this purpose, I developed the function Grid.display() to conveniently visualize the structure of the grids and get a clearer idea of what is going on. It offers a human-readable way to represent the data. There is a small commented snippet of code at the end of the main() function that generates image and text files containing the critical information of all the grids belonging to the final population once the genetic algorithm has finished. The Grid.display() function is only suited for small grids due to the screen space constraints, however, it is still quite useful to debug and run tests.

Screenshots

alt text

Visualization using the Grid.display() function. The image illustrates the fusion process between the bottom-left and the upper-right grid. The result is the bottom-right grid.

alt text

Debugging the program. On top of the image, there is the path generated by the algorithm for the input sentence: 'je voyager train'. The red arrows describe this path, and the blue numbers are the cost for each step. Finally, there is the comparison between the cost obtained and the cost calculated by hand.

Author

Carlos Vargas Figueroa @CarlosVargasF.

grid_generation's People

Contributors

carlosvargasf 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.