Tabla is an accelerator generator framework for geometric machine learning algorithms. It is an open source project under the Apache license.
TABLA provides a Domain Specific Language, specifically designed to make the implementaion of geometric machine learning algorithms easier.
model_input i[x], j[y][z];
m = 10;
m = 15;
model_input x[m];
model_output y[n];
iterator i[0:10]; // all iterator arguments as integer literals
iterator j[m:n]; // all iterator arguments as integer variables (that should havebeen decalred before this statment)
iterator k[m:10]; // one iterator argument as an integer variable, the other as an integer literal
iterator l[0:n]; // same as before, but the other way around
iterator x;
Variable names follow the similar rules as the ones in C. The properties are:
a b[m] c[x][y] d[i][j][k]
The basic operators follow the following precedence from highest to lowest:
Aside from the basic operators, there are two types of operations: group and non linear. In group operations, pi and sum operates on two arguments, whereas norm operates on one argument. However, even though pi and sum operates on two arguments, this is only in a semantic manner. Syntatically, it appears they take in one. In other words, in between the parentheses, pi and sum operators do not require an argument followed by a comma and then another argument, as one would normally expect from other languages. For example, if one would write a sum function in C, it would look like:
    sum(2, 3);
However, in TABLA, it would look something like this:
    sum[i](x[i] * w[j][i]);
where i and j are iterators. Notice there is no comma (,) inside the parentheses.
Also, since pi and sum are operated group-wise, they require an iterator. This is wrapped inside square brackets, as shown above in the sum operator. Syntatically, sum and pi operators come in the following format:
    (SUM | PI) LEFT_BRACK ID RIGHT_BRACK LEFT_PAREN expr RIGHT_PAREN SEMI
whereas the rest of the operators are expressed in the following format:
    (NORM | GAUSSIAN | SIGMOID | SIG_SYM | LOG) LEFT_PAREN expr RIGHT_PAREN SEMI
<program> ::= <data_decl_list> <stat_list> EOF <data_decl_list> ::= <data_decl> <data_decl_list> | "" <data_decl> ::= <data_type> ";" <data_type> ::= <non_iterator> <var_list> | "gradient" <var_with_link_list> | <iterator> <var_list_iterator> | <id> "=" <intlit> <non_iterator> ::= "model_input" | "model_output" | "model" <iterator> ::= "iterator" <id> ::= (<lower> | <upper>) , {(<lower> | <upper> | <digit> | "-")} , <prime> <prime> ::= "'" | "" <lower> ::= "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k' | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" <upper> ::= "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z" <digit> ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" <intlit> ::= "0" | <digit> - "0" , {<digit>} <var_with_link_list> ::= <var> "->" <var_with_link_list_tail> <var_with_link_list_tail> ::= "," <var_with_link_list> <var_with_link_list_tail> | "" <var_list> ::= <var> <var_list_tail> <var> ::= <var_id> <var_id> ::= <id> <id_tail> <id_tail> ::= "[" (<id> | <intlit>) "]" <id_tail> | "" <var_list_tail> ::= "," <var_list> | "" <var_list_iterator> ::= <id> "[" (<id> | <intlit>) COLON (<id> | <intlit>) "]" <stat_list> ::= <stat> <stat_list> | "" <stat> ::= <var> "=" <expr> ";" <expr> ::= <term2> <term2_tail> <function> ::= "pi" | "sum" | "norm" | "gaussian" | "sigmoid" | "sig_sym" | "log" <function_args> ::= "[" <id> "]" "(" <expr> ")" | "(" <expr> ")" <term2_tail> ::= <compare_op> <term2> <term2_tail> | <term2> ::= <term1> <term1_tail> <term1_tail> ::= <add_op> <term1> <term1_tail> | <term1> ::= <term0> <term0_tail> <term0_tail> ::= <mul_op> <term0> <term0_tail> | <term0> ::= <var> | "(" <expr> ")" | <intlit> | <function> <function_args> <mul_op> ::= "*" <add_op> ::= "+" | "-" <compare_op> ::= "<" | ">"
This source code is published under the terms specified in the Apache license.
Copyright 2016 Hadi Esmaeilzadeh
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.