Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
cognition:aiexec [2023/02/02 03:20] optrixcognition:aiexec [2025/12/18 22:50] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +====AIExec====
 +
 +AIExec (AI Execute) is the most common tool used when manually creating or running Cognition-based AIs.
 +
 +In practise, it takes three parameters.
 +
 +    aiexec.py <AI Name> <Action> --dir <directory where AIs are stored>
 +    
 +The **dir** parameter points to a folder where the JSON files that describe your AIs are stored. Each of those files should be in the [[cognition_file_format]].
 +
 +The **AI Name** is the name of the AI, minus the //.json// extension. 
 +
 +There are several different options for the //Action// parameter...
 +
 +===Actions===
 +
 +^Action^Description^
 +|gather|Download the training data for this AI, deleting any existing data|
 +|build|Train the AI, if required|
 +|retrain|Train the AI, deleting the existing AI if needed|
 +|regen|Regenerate the entire AI|
 +|test|Test the AI against its training data to determine accuracy|
 +|coverage|Create a [[coverage report]] for this AI|
 +|now|Executing the AI based on the current live values. Will also gather raw data and train the AI if required.|
 +|curinputs|Get the current input values|
 +|run|Run the AI. Requires the //start//, //end// and //grain// parameters|
 +|find|Find events using the AI. Requires the //start//, //end// and //grain// parameters|
 +|inputs|Gets a list of the inputs to this AI|
 +|correct|Make a manual correction to the AI|
 +|addsample|Adds a new sample time to the training data. Uses the //start// and optionally the //end//, //inputs//, //outputs// and //root// parameters|
 +
 +===Extra Parameters===
 +
 +^Parameter^Used For^Example^
 +|--force|now|A comma-delimited list of inputs that you'd like to force to a specific value. Leave an option empty (ie. ",,") to use the current value.|
 +|--inputs|correct|A comma-delimited list of the //AI Inputs// you'd like to manually correct the //output// for|
 +|--outputs|correct|A comma-delmited list of the //AI Outputs// you'd like to get for the given //AI Inputs//.|
 +|--start|run,find|The date (in YYYY-MM-DD HH:MM:SS) to start the execution of your AI|
 +|--end|run,find|The date (in YYYY-MM-DD HH:MM:SS) to finish execution of your AI|
 +|--grain|run,find|The data resolution when finding or running|
 +|--root|run,find,now|The ARDI ID number of the asset that this AI should be run on|
 +|--format|run|The output format for the run data|
 +|--span|run|When being used over long time periods, //span// controls the size of the 'chunks' that are read. Value in hours. Defaults to 24|