Quick Start Guide to MDF
This is a quick guide to the various parts of the ModECI Model Description Format (MDF) specification, API and examples.
Specification of MDF language
Installation of Python API
There is a prototype implementation of an API (Application Programming Interface) in Python which can be used to build models in the MDF format, as well as save (serialize) the models in JSON, YAML and other formats. It also has an Execution Engine which can be used to execute/evaluate the models.
Use pip to install the latest version of MDF (plus dependencies) from PyPI:
pip install modeci_mdf
Examples of MDF
Some basic examples of models in MDF format which illustrate how a model can be 1) created using the Python API, 2) saved to JSON and YAML, 3) exported to graphical form and 4) executed to evaluate all parameters, can be found here.
A step-by-step guide to using MDF
This Jupyter notebook provides a step-by-step guide to creating, saving and executing an MDF model in Python.
More complex examples
Whenever a model is exchanged between different environments it will usually be a serialized form of the model which is exported/imported. Python scripts can be used to generate MDF models (e.g. this), but the models are saved in standardized format in either text based JSON or YAML formats or in binary BSON format.
Currently supported environments
ONNX (Open Neural Network Exchange) is an important format for exchanging models between machine learning environments. It is used in the MDF function ontology, and models in ONNX format can be exported to MDF. See here for more details. Converting MDF->ONNX is best enabled currently by converting the model to PyTorch and from there to ONNX.
Planned environments to support
The MDF format was first proposed following a meeting organised at Princeton in July 2019 by Russ Poldrack of the Center for Reproducible Neuroscience (CRN) at Stanford and the Brain Imaging Data Standard (BIDS) initiative. While the prototype Python API and MDF specification have been developed independently of the BIDS initiative (which focusses on exchange of neuroimaging data), there is interest in that community to allow MDF to be used as a way to encode models of neuronal activity, which can be embedded in BIDS datasets. The BIDS Extension Proposal Computational Models is a potential avenue for this.
Background to the ModECI Initiative
See here for details about the Model Exchange and Convergence Initiative (ModECI).