In this post I want to experiment with nouns, verbs and syntax structures we can expect one day in high-level declarative AI languages akin to Apache Pig or SDPL [3] for data processing today.
Most applications of AI/ML produce models. In very simplistic terms, these are numbers (weights) assigned to every node in the neural network, or numbers (weights) for regression formulas. Models also have parameters. Among them - number of inputs for neural network or features for regression.
Let's use verb LOAD to load a model and verb STORE to persist it.
For most Deep Neural Networks, models are expensive to train, and will likely be re-used as open source libs are today.
Let's use verb EXTEND for declaring new derived models and REUSE # LAYERS construct to identify depth of model reuse. Verb TRAIN will commence model training and preposition WITH will point to the data repository.
Just like TensorFlow today abstracts the computing devices [4], and like Flow [5] abstracts action from the execution cluster, we should expect our declarative language to abstract training and execution. Hence, lets add --engine to the command-line arguments.
Two nouns to complete the picture: INPUT and OUTPUT. Both need detailization: SCALE FOR to match input data to AI/ML model requirements and IN FORMAT to define data format.
In summary, let's scribble an AI program in our hypothetical MDAL language:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
base_model = LOAD "https://github.com/tensorflow/models/tree/master/official/resnet" | |
my_model = EXTEND base_model REUSE 5 LAYERS | |
TRAIN my_model WITH "dfs://mycompany.com/datasets/mymodel" | |
input = INPUT "pubsub://subscriptions/myproject/raw-feed" IN FORMAT json SCALE FOR my_model | |
output = OUTPUT "pubsub://publishers/myproject/prognosis" IN FORMAT json | |
EXECUTE my_model ON input INTO output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mdal example.mdal --engine tensorflow |
Cheers!
[1] https://www.bloomberg.com/news/articles/2018-02-07/just-how-shallow-is-the-artificial-intelligence-talent-pool
[2] https://www.computerworld.com/article/2483690/it-careers/india-to-overtake-u-s--on-number-of-developers-by-2017.html
[3] https://github.com/mushkevych/sdpl
[4] TensorFlow dynamic placer
http://download.tensorflow.org/paper/whitepaper2015.pdf
[5] https://github.com/mushkevych/synergy_flow/