FENNIX

Fast Experimentation with Neural Networks


Language

Scripts in FENNIX are written in a very basic (an therefore limited) language. This language supports the following features:

The following subsections give more details about each one of the capabilities of the language.


Comments

Comments in FENNIX start with the characters //, and end with the end of the line. For instance:


	//This line is a comment
	
Back to top

Variables

Variable names must start with a letter between 'a' and 'z' (either lowercase or uppercase). They can contain numbers from '0' to '9' and the special character '_'. Variables in FENNIX can store elements of different types:

The type of the variables is determined automatically when a value is assigned to it. You do not need to previously declare them. Moreover, you can assign a value to a variable by using the sign '='. For instance:

	a = 3.14159	//will create a variable named 'a', and will assign the real value 3.14159 to it.
	b = true	//will create a variable named 'b', and will assign the boolean true to it.
	c = "thing"	//will create a variable named 'c', and will assign the string "thing" to it.
	
Back to top

Arrays

Arrays in FENNIX are collections of objects of multiple types that can be accessed by using a single name and an index. Arrays are created by enclosing a comma (,) separated list of elements by square brackets ([ and ]). These are some examples:


	parameters = [10, 20, 30, 40]
	fileNames = ["file1.txt", "file2.txt", "file3.txt", "file4.txt"]
	a = 3.14159
	b = true
	c = "thing"
	d = [a, b, c]
	
To access to the n-th element of the array, you must put the name of the array followed by the index of the element enclosed by square brackets, starting at 0 (zero). These are some examples:

	p1 = parameters[2]
	name = fileNames[1]
	pi = d[0]
	index = 3
	file = fileNames[index]
	
Back to top

Mathematical operations

The following mathematical operators are available in FENNIX:

Binary operators
    +  Addition
    -  Difference
    *  Multiplication
    /  Division
    %  Modulus
    ^  Power

Unary operators
    ++  Increment (postfix)
    --  Decrement (postfix)
    -*  Sign change (prefix)

Moreover, you should use parentheses ( and ) to make sure that the precedence of the operators is the one you want.

Back to top

Logical operations

The following logical operators are available in FENNIX:

Binary operators
    &&  And
    ||  Or
    ^^  Xor

Unary operators
    !  Negation

Back to top

Comparisons

In FENNIX, comparisons in can be made by using the following binary operators:

    ==  Equal
    !=  Different
    >   Greater than
    >=  Greater or equal than
    <   Smaller than
    <=  Smaller or equal than

These comparisons yield a logical value true or false.

Back to top

Instantiation of FNNXObjects

FNNXObjects can be instantiated by using the reserved word new and putting into parentheses ( and ) the name of the object. For example:


	plotter = new(FNNXPlotter)
	
If the object has some configuration parameters, you can use curly brackets { and } to create a block of code containing the initialization values for the parameters of the object. For example:

	saver = new(FNNXSaver) {
		file = 	"results.fxr"
	}
	
Back to top

Calls to FNNXFunctions

FNNXFunctoins can be called by using the reserved word call and putting into parentheses ( and ) the name of the function. If the function has some configuration parameters, you can use curly brackets { and } to create a block of code containing the initialization values for the parameters of the function. For example:


	call(FNNXInitNetwork) {
		network = 	mlp
	}
	
Back to top

Calls to primitive functions

FENNIX has some primitive functions. These functions are called by using their name and specifying between parentheses ( and ) the object they receive as argument. These are the primitive functions of FENNIX:

quit()Quits FENNIX
pause()Pauses the execution of the current script
resume()Resumes the execution of a previously paused script
stop()Stops the execution of a script
source()Launches a script. A file name must be specified as argument
min()Returns the minimum value in an array. An array must be given as argument
wMin()Returns the position (index) of the minimum value in an array. An array must be given as argument
max()Returns the maximum value in an array. An array must be given as argument
wMax()Returns the position (index) of the maximum value in an array. An array must be given as argument
length()Returns the length of an array. An array must be given as argument
help()Shows the description of a given FNNXObject. The name of the FNNXObject must be given as argument
show()Shows the content of a variable. A variable name must be given as argument
concat()Concatenates two or more strings. Two or more strings must be given as arguments
new()Instantiates a FNNXObject. See details in previous subsections
call()Calls a FNNXFunction. See details in previous subsections
Back to top

Conditional execution

Conditional execution of a block of code in FENNIX can be achieved by using the reserved word if followed by a conditional expression (a comparison for instance) between parentheses. Thus, if the expression between parentheses yields true the code after the if is executed. Moreover, there is also the corresponding reserved word else that can be placed after the block of code following the if word. The block of code following the else word will be executed if the conditional expression yields false. This is an example:


	a = min(anArray)
	if (a < 0) {
		a = 0	
	}
	else {
		show("a is not smaller than 0")
	}
	
Back to top

Conditional repetition

FENNIX has the reserved word while to repeatedly execute a block of code. After the word while, you must specify a looping condition between parentheses. If the condition yields true, the block of code following the condition is executed until the condition yields false. This is an example:


	b = 0
	while(b < 10) {
		show(b)
	}
	show(concat("The loop ended with a value of: ", b))
	
Back to top

Last modification 10 April 2012
by Héctor Satizábal.