Macros are recorded whileEasyNN-plus is being used. Recording is started with Record on the Macro menu or Ctrl + F2. Recording is stopped using Stop recording on the Macro menu or Ctrl + F3. EasyNN-plus macros are text files with the .ens extension. Functions are fully recorded when possible but some are only partially recorded or they are nested within other functions. The right click, grid pre-processing functions are not recorded.
Script Commands can be added to macros using Commands on the macro menu. Recording can be continued after adding script commands or recording can be stopped and the commands can be played immediately. Multiple script commands are separated with a ; character. For example, if the line f; stl; fps(0,0,1,100) is entered it will be split into three separate script commands in the macro. If the macro is then played back the commands will cause the currently open network to forget learning, start learning and then stop learning after 100 cycles. Alternatively recording can be stopped and the commands played by adding three colon characters. The example would become f; stl; fps(0,0,1,100); ::: .
Whole scripts can be added to macros using Add Expanded Script on the Macro menu. The selected script file will be expanded into its original format and then each command will be added to the macro. Recording can be continued after adding an expanded script file.
A script file can be added at the end of a macro using Add Script File on the macro menu. This will put a RunScriptFile(script file); command into the macro. When the macro is played back it will play the recorded functions and script commands. It will then run the script file and terminate the macro.
Playback is started using Play on the Macro menu, Ctrl + F4 or using Run Script File on the File menu. Macro files can also be passed to EasyNN-plus as a parameter in the same way as script files.
A macro called specscr.ens is included in the Samples folder that creates a network similar to the Species.tvq sample.
EasyNN-plus scripts are text files with .ens or .txt extensions and can be edited with any text editor. Script files can be loaded and run from within EasyNN-plus using Run Script File on the File menu. They can also be passed to EasyNN-plus as a parameter.
Scripts can contain commands to import the data, build the neural network, control learning, validating and querying.
Warning: Script commands call low level functions. The command parameters are validated but some error checking has to be disabled so that the scripts will run. All scripts should be designed and tested very carefully. Script commands that will overwrite existing files should only be used when backup files are available.
Script files based on the currently loaded network can be produced using Generate Script File on the File menu. The generated files will contain commands to create the grid columns and set the network controls. Commands to create the grid rows, import the data and build the neural network can then be added.
Scripts can be tested by stepping through them one line at a time. Start the script with an ess command to enable single step mode.
The pause command can be used to temporarily stop and exit from a script. When the script is restarted it will run from the line after the pause.
The commands and error messages that are produced while running the script can be directed to a log file by including the lsc command in the script. The script will stop if the lsc command fails to open the log file.
The name of a script file can be passed as an EasyNN-plus parameter in the command line.
This test line shows how to call EasyNN-plus from Start > Run.
The script imports atest.txt and uses it to create a network. The files ascript.txt and atest.txt are included in the Samples folder.
Macro and Script Commands.
Comments: Lines starting with any non alpha character can be used for comments.
String parameters are checked to be valid strings.
Integer and double parameters are checked to be within the valid range.
Bit parameters are checked to be 0 (false) or above 0 (true).
Macro parameters are produced while recording.
Macro functions can be included in Scripts but they must be tested very carefully. Script command names are shown in black, macro function names are shown in red. When a macro function has exactly the same parameters as a script command it is listed below the command. All macro functions are case sensitive. Script commands in full or as short names can be in any case.
AddCol Adds a column
bit Ask (ignored)
bit New column
AddRow Adds a row
bit Ask (ignored)
autosave Set AutoSave
string File base name
int Cycles per save
bit Save if lower error
bit Save if validating results improve
string File name
string File name
backto Go back to label
Warning: Only one backto or bt command is allowed in a script.