Git Product home page Git Product logo

nn-mapping's Introduction

nn-mapping

nn-mapping maps the given JSON objects to JSON structure which are more suitable for neural network processing. Neural networks need float values as input and output. nn-mapping maps deep structures and non numeric values n dimensional float arrays and key value pairs. Key value pairs are used as abstraction layer for the model. The mapping is done based on a JSON mapping definition.

Usage

Command line

The module installs the nn-mapping command line tool in the npm path. The following arguments are required to run the tool:

nn-mapping --mapping <mappingDefinition> <inputFile> > <outputFile>
  • mappingDefinition: Path to the file that contains the JSON mapping definition.
  • inputFile: The JSON input. stdin is used if this arguments is not given.
  • outputFile: The mapped JSON is written to stdout.

API

The module exports the following functions:

  • mapItem(mapping, object): Maps the given object and returns the mapped object.
  • mapArray(mapping, objects): Maps an array of objects and returns an array of the mapped objects.
  • mapStringStream(mapping, stream): Parses the given JSON string stream and maps each object of the array.

Mapping definition

The mapping definition is JSON object. It starts with an object mapping.

Object mapping

  • map: An array of property mappings.
  • loop An array of array mappings.

Property mapping

  • group: The output group the value will be assigned to.
  • property: The property that will be used as source for the mapping.
  • mapping: The value mapping.

Value mapping

  • neuron: The name of the neuron the value will be assigned to.
  • equals: The mapping will be only processed if value is equals to the value of equals.
  • value: A hard coded value. Useful conditional mappings.

Array mapping

  • group: The output group for the array
  • property: The property that contains the array.
  • map: An array of property mappings.
  • loop An array of array mappings.

Example: Calculator

The examples folder contains a simple calcualtor example, which generates datasets sequences of numbers and +-* operations. The calculator.sh script prepares two training datasets with different sequence lengths and a test dataset. It also does the mapping. To run the examples switch to the example folder and run:

./calculator.sh

Keras Gaia is able to process the dataset. It also contains prepared example projects for the nn-mapping calculator example.

nn-mapping's People

Contributors

bergos avatar

Watchers

 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.