JSON API

The machine learning and signal processing classes are able to save and load their data in JSON format. This allows for data to be:

  • Moved between different instantiations and switch between different setups
  • Shared between C++, JavaScript, Wekinator, etc.
  • Uploaded to and Downloaded from RepoVizz2

The JSON API has the following methods:

getJSON() — returns a JSON string describing the model or data

writeJSON(<filepath>) — writes a file with the JSON description

putJSON() — updates the data or model with a JSON description

readJSON(<filepath>) — reads a JSON description from a file and updates the object

The JSON representations produced and consumed by this API follow the specification below.

 

RAPID-MIX JSON Specification

The RAPID-MIX API specifies a set of JSON formats to simplify the exchange of training data, training configurations, trained models, and signal processing graph descriptions between any RAPID-MIX based applications.

  • The simplest object used in RAPID-MIX is what we call an example, in other words a labelled recording of a time series of vectors of numbers, of length 1 or greater.

  • Then we have the training set, which is mostly constituted by a set of examples.

  • In addition to the actual training data shown above, we need a couple of extra informations to be able to train a model. One of them is the training configuration.

  • Once a model has been trained from data and configuration, it also needs to fit the following specification in order to be exchanged and loaded properly.

  • Finally, it is also possible to describe signal processing graphs in the following way.

  • Built on top of these specifications, we can send properly formatted http requests and responses around. That’s what the Como web service does, using the following format.