IGLib
1.7.2
The IGLib base library for development of numerical, technical and business applications.
|
Base class for loadable scripts that are used as custom applications that inclued neural networks approximations and optimization. More...
Classes | |
class | StoredScriptSettings |
In methods of this class you will find all the settings that apply to this script. More... | |
Public Member Functions | |
LoadableScriptShellNeuralBase () | |
override void | Analyse (Num.IAnalysisResults anRes) |
Dummy analysis, jsut throws the exception. More... | |
virtual string | Test (string[] arguments) |
Runs a custom basic test. More... | |
virtual string | Custom (string[] arguments) |
Runs a custom test. More... | |
virtual string | RunParallelSimulations (string[] arguments) |
Runs multiple simulations in parallel threads and saves results in each parallel thread. More... | |
virtual string | CollectParallelSimulationResults (string[] arguments) |
Collects results of simulations run in parallel threads, joins them into a single object and saves them. More... | |
override void | Script_AddCommands (ICommandLineApplicationInterpreter interpreter, SortedList< string, string > helpStrings) |
Adds commands to the internal interpreter. More... | |
virtual IVector | TestApproximation (IVector parameters) |
Performs a test approximation at the specified vector of parameters and outputs and returns results. More... | |
virtual IVector[][] | TestApproximationTable (int numPoints) |
Calculates a table of specified number of approximations, with parameters running between two points that are chosen by the algorithm. More... | |
virtual IVector[][] | TestApproximationTable (IVector param1, IVector param2, int numPoints) |
Performs a table of approximatinos between two specified vectors of approximation input parameters, and outputs results. It also returns the table of results (approximated output values in form of vectors). More... | |
virtual AnalysisResults | TestAnalysis (IVector parameters) |
Performs test analysis at the specified optimization parameters and outputs results. More... | |
virtual AnalysisResults[] | TestAnalysisTable (int numPoints) |
Calculates a table of specified number of analyses, with parameters running between two points that are chosen by the algorithm. More... | |
virtual AnalysisResults[] | TestAnalysisTable (IVector param1, IVector param2, int numPoints) |
Performs a table of direct analyses between two specified vectors of optimization parameters, and outputs results. It also returns the table of analysis results. More... | |
virtual void | OptimizeSimplex () |
virtual void | TransfNeuralToOptimizationParameters (IVector neuralParameters, ref IVector optimizationParameters) |
Maps input parameters for neural network to optimization input parameters. More... | |
virtual void | TransfOptimizationToNeuralParameters (IVector optimizationParameters, ref IVector neuralParameters) |
Maps optimization input parameters to neural network input parameters. More... | |
delegate string | ParallelRunDelegate (int threadIndex) |
virtual void | ParSimBegin (int numThreads) |
Launches parallel jobs. More... | |
virtual void | GatherParallelResults (int numThreads) |
Reads results form all parallel threads, gathers them in a single training set, and saves them in the template optimiation directory. More... | |
virtual string | ParSimGetOptimizationDirectoryPath (int threadIndex) |
Returns path to the directory containing optimization data for the specified parallel thread. More... | |
virtual string | ParSimGetMutexName (int threadIndex) |
Returns name of the mutex for locking data on disk that is used by the specified parallel thread. More... | |
virtual string | ParSimGetParallelResultsFilePath (int threadIndex) |
Returns path of the file where resuls of calculation in the specified parallel thread are stored. More... | |
virtual string | GetParallelResultFilePath () |
Returns path of the file where resuls of calculation in the specified parallel thread are stored. More... | |
virtual void | ParSimPreparelDirectory (int threadIndex) |
Prepares data for running calculations in the parallel thread with the specified index. More... | |
void | ParSimAddResults (int threadIndex, SampledDataSet results) |
Reads results of the specified thread and adds them to the existing training set. More... | |
string | ParSimRunJob (int threadIndex) |
Runs the job in the specified parallel thread. More... | |
virtual void | ParSimGetNextInput (ref IVector simInput) |
Generates the next vector of simulation input parameters that will be used for calculation of a new parallel simulation. More... | |
virtual void | ParSimGetNextNeuralInput (ref IVector simInput) |
Generates the next vector of neural input parameters that will be used for calculation of a new training element. More... | |
virtual string | ParSimGetSimulationDirectoryPath (int threadIndex) |
Returns the simulation directory for the specified parallel calculation thread. More... | |
virtual IResponseEvaluatorVectorSimple | ParSimGetSimulator (int threadIndex) |
Creates simulator file manager for the simulator that will the specified parallel task. More... | |
abstract void | TransfSimulationToNeuralInput (IVector original, ref IVector result) |
Transforms the specified vector of simulation input parameters to the vector of neural input parameters and stores the vector to the specified variable. More... | |
virtual void | TransfNeuralToSimulationInput (IVector original, ref IVector result) |
Transforms the specified vector of neural input parameters to the vector of simulation input parameters and stores the vector to the specified variable. More... | |
virtual void | TransfSimulationToNeuralOutput (IVector original, ref IVector result) |
Transforms the specified vector of simulation output values (results) to the vector of neural output values and stores the vector to the specified variable. More... | |
virtual void | TransfNeuralToSimulationOutput (IVector original, ref IVector result) |
Transforms the specified vector of neural output values to the vector of simulation output values (results) and stores the vector to the specified variable. More... | |
virtual SampledDataElement | GetTrainingElement (int i) |
Gets the training element with the specified index (chosen out of al training points, including verificaion points). More... | |
virtual bool | IsVerificationPoint (int trainingPointIndex) |
Whether the training point with the specified index is a verification points and has not been used in training. More... | |
List< SampledDataElement > | GetTrainingElements (bool includeVerificationPoints) |
Returns a list of all neural training elements. More... | |
List< SampledDataElement > | GetTrainingElements (bool includeVerificationPoints, bool includeNonVerificationPoints) |
Returns a list of all neural training elements. More... | |
virtual void | GetNeuralInputPerturbance (double ratio, ref IVector perturbance) |
Returns a perturbance vector whose componenets represent magnitudes of perturbances of neural input parameters with the specified relative ratio with corresponding parameters' scaling lengths. More... | |
virtual void | GetNeuralOutputPerturbance (double ratio, ref IVector perturbance) |
Returns a perturbance vector whose componenets represent magnitudes of perturbances of neural output values with the specified relative ratio with corresponding values' scaling lengths. More... | |
virtual void | GetNeuralInputVector (double relativeComponents, ref IVector inputVector) |
Returns an input vector whose components are at specified relative distances (with respect to full range) from lower bounds on componens of input vectors. More... | |
virtual void | GetNeuralOutputVector (double relativeComponents, ref IVector outputVector) |
Returns an output vector whose components are at specified relative distances (with respect to full range) from lower bounds on componens of input vectors. More... | |
virtual void | GetNeuralInputVector (IVector relativeComponents, ref IVector inputVector) |
Returns an input vector whose components are at specified relative distances (with respect to full range) from lower bounds on componens of input vectors. More... | |
virtual void | GetNeuralOutputVector (IVector relativeComponents, ref IVector outputVector) |
Returns an output vector whose components are at specified relative distances (with respect to full range) from lower bounds on componens of input vectors. More... | |
virtual void | GetNeuralInputRelative (IVector inputVector, ref IVector relativeComponents) |
Calculates relative components (running from 0 to 1 within bounds for specified vector component) for the specified vector of neural input parameters. More... | |
virtual void | GetNeuralOutputRelative (IVector outputVector, ref IVector relativeComponents) |
Calculates relative components (running from 0 to 1 within bounds for specified vector component) for the specified vector of neural output values. More... | |
virtual double | InputDistance (IVector v1, IVector v2) |
Returns measure of distance between two vectors in the space of input parameters. Euclidean norm scaled accorging to individual parameter ranges is returned. More... | |
virtual double | OutputDistance (IVector v1, IVector v2) |
Returns measure of distance between two vectors in the space of output parameters. Euclidean norm scaled accorging to individual parameter ranges is returned. More... | |
virtual double | InputDistance (IVector v1, int trainingPointIndex) |
Returns measure of distance between the specified neural input vector and vector of input parameters of the training point with the specified index. More... | |
virtual double | OutputDistance (IVector v1, int trainingPointIndex) |
Returns measure of distance between the specified neural output values vector and vector of output values of the training point with the specified index. More... | |
virtual int | GetClosestInputIndex (IVector v1, bool includeVerificationPoints) |
Returns index of training element with the shortest distance of its input parameters to the specified vector. More... | |
virtual int | GetClosestOutputIndex (IVector v1, bool includeVerificationPoints) |
Returns index of training element with the shortest distance of its output values to the specified vector of output values. More... | |
void | TestClosestPoints (int numClosestPoints, bool includeVerificationPoints, bool printByComponents, params IVector[] points) |
For each point in the specified array, the training points are sorted according to the distance to this point, and data for the specified number of closest points are written. More... | |
void | TestClosestPoints (int numClosestPoints, bool includeVerificationPoints, bool printByComponents, bool printIndividualPointsComp, params IVector[] points) |
For each point in the specified array, the training points are sorted according to the distance to this point, and data for the specified number of closest points are written. More... | |
void | TestClosestPoints (int numClosestPoints, bool includeVerificationPoints, bool printByComponents, params SampledDataElement[] points) |
For each point (training element) in the specified array, the training points are sorted according to the distance to this point, and data for the specified number of closest points are written. More... | |
void | TestClosestPoints (int numClosestPoints, bool includeVerificationPoints, bool printByComponents, bool printIndividualPointsComp, params SampledDataElement[] points) |
For each point (training element) in the specified array, the training points are sorted according to the distance to this point, and data for the specified number of closest points are written. More... | |
virtual void | NeuralCalculate (params double[] inputParameters) |
Calculates approximation at specified input parameters. More... | |
virtual void | NeuralCalculate (IVector inputParameters) |
Calculates approximation at specified input parameters. More... | |
virtual void | NeuralCalculate (IVector inputParameters, ref IVector outputValues) |
Calculates approximation at specified input parameters. More... | |
virtual List< SampledDataElement > | GetRandomTrainingElements (int numElements, bool includeVerificationPoints) |
Creates and returns a list of training elements that are randomly chosen from the current training set. Trainingpoints that are not verification points are always included in the set of points for selection. More... | |
virtual List< SampledDataElement > | GetRandomTrainingElements (int numElements, bool includeVerificationPoints, bool includeNonVerificationPoints) |
Creates and returns a list of training elements that are randomly chosen from the current training set. More... | |
virtual List< SampledDataElement > | GetRandomTrainingElements (IRandomGenerator rand, int numElements, bool includeVerificationPoints) |
Creates and returns a list of training elements that are randomly chosen from the current training set. Trainingpoints that are not verification points are always included in the set of points for selection. More... | |
virtual List< SampledDataElement > | GetRandomTrainingElements (IRandomGenerator rand, int numElements, bool includeVerificationPoints, bool includeNonVerificationPoints) |
Creates and returns a list of training elements that are randomly chosen from the current training set. More... | |
virtual IVector | GetRandomNeuralInput () |
Creates and returns a random vector of neural input parameters whose elements (components) lie within the lower and upper bounds on parameters. More... | |
virtual void | GetRandomNeuralInput (IRandomGenerator rand, ref IVector result) |
Generates a random vector of neural input parameters whose elements (components) lie within the lower and upper bounds on parameters, and stores it to the specified vector. More... | |
virtual IVector | GetRandomNeuralInput (IRandomGenerator rand) |
Creates and returns a random vector of neural input parameters whose elements (components) lie within the lower and upper bounds on parameters. More... | |
virtual void | GetRandomNeuralInput (ref IVector result) |
Generates a random vector of neural input parameters whose elements (components) lie within the lower and upper bounds on parameters. More... | |
virtual IVector | GetRandomNeuralOutput () |
Creates and returns a random vector of neural output values whose elements (components) lie within the lower and upper bounds on values. More... | |
virtual IVector | GetRandomNeuralOutput (IRandomGenerator rand) |
Creates and returns a random vector of neural output values whose elements (components) lie within the lower and upper bounds on values. More... | |
virtual void | GetRandomNeuralOutput (ref IVector result) |
Generates a random vector of neural output values whose elements (components) lie within the lower and upper bounds on values. More... | |
virtual void | GetRandomNeuralOutput (IRandomGenerator rand, ref IVector result) |
Generates a random vector of neural output values whose elements (components) lie within the lower and upper bounds on neural output values, and stores it to the specified vector. More... | |
virtual void | PrepareNeuronsTable (int minNeurons, int maxNeurons, int numNeurons, ref int[] neurpnsTable) |
Prepares table of neurons in geometric sequence. More... | |
void | TrainANN (int annType, int NumNeurons, int MaxEpochs, int EpochsInBundle, double LearnignRate, double Momentum, double InputSafetyFactor, double OutputSafetyFactor, double PercentVerificationPoints) |
Train the artificial neural network. More... | |
virtual string | CreateDistortedModelData (string[] arguments) |
Creates data for distorted model and stores the data in the specified directory. More... | |
virtual void | TestDistances (int referencePointIndex, int maxNumPoints) |
Test of distances of a specified number of training points with respect to the training point with specified index, in the input parameters space as well as in the output parameter space. More... | |
virtual void | TestNeuralSpeed (int numEvaluations) |
Performs test of speed of calculation of neural network. More... | |
virtual void | PrintNeuralData () |
This example demonstrates how to extract data necessary for definition of optimization problems. More... | |
void | SaveSensitivityCSV () |
Saves sensitivity test in csv file. More... | |
Public Member Functions inherited from IG.Lib.LoadableScriptShellBase | |
LoadableScriptShellBase () | |
Constructor. More... | |
virtual bool | RepairSimulationParameters (IVector parameters) |
Repairs simulation parameters, if necessary, in such a way that values are consistent with simuation data (e.g. spacing of nodes). More... | |
virtual void | SimulatorCalculateResponse (IResponseEvaluatorVectorSimple simulator, IVector inputParameters, ref IVector outputValues) |
Calculates vector response by the specified simulator, and stores output values to the specified vector variable. More... | |
void | SimulatorCalculateResponse (IVector parameters, ref IVector outputValues) |
Calculates vector response by the main simulator of the script, and stores output values to the specified vector variable. More... | |
Public Member Functions inherited from IG.Lib.LoadableScriptOptShellBaseControllable | |
LoadableScriptOptShellBaseControllable () | |
Creates a LoadableScriptOptBase object. More... | |
Public Member Functions inherited from IG.Lib.LoadableScriptOptBase | |
LoadableScriptOptBase () | |
Creates the LoadableScriptOptBase object. More... | |
abstract void | Analyse (IAnalysisResults anRes) |
Performs direct analysis for optimization problems. This method must be overridden in derived classes where one wants to have direct analysis defined. More... | |
Public Member Functions inherited from IG.Lib.LoadableScriptBase | |
LoadableScriptBase () | |
Argument-less constructor. If argument-less constructor is called then initialization is not performed and will be performed later. More... | |
string | Run (string[] arguments) |
Performs the action of this object. Override this in derived classes! More... | |
void | Initialize (string[] arguments) |
Initializes the object. If not called explicitly, this method is automatically called at the first call to the Run method. More... | |
virtual string | Script_DefaultInitialize (string[] arguments) |
Default initialization method for scripts. More... | |
virtual string | Script_DefaultRun (string[] arguments) |
Default run method for the script. Can be used when only installed commands are run by hte script. More... | |
virtual ICommandLineApplicationInterpreter | Script_CreateInterpreterWithoutCommands () |
Creates and returns an interpreter that can be used as script's internal interpreter for running script's commands. More... | |
delegate string | Script_CommandDelegate (string[] args) |
Delegate for commands that are installed on script's internal interpreter (property Script_Interpreter). More... | |
void | Script_AddCommand (string commandName, Script_CommandDelegate command, string helpString) |
Adds a new internal script command under specified name to the internal interpreter of the current script object. More... | |
virtual void | Script_AddCommand (ICommandLineApplicationInterpreter interpreter, SortedList< string, string > helpStrings, string commandName, Script_CommandDelegate command, string helpString) |
Adds a new internal script command under specified name to the internal interpreter of the current script object. More... | |
string | Script_GetHelpString (string scriptCommandName) |
Returns help string for internal script command with specified name, or null if help string is not installed for such a command. More... | |
void | Script_PrintCommandsHelp () |
Prits help for the installed internal commands of the script. More... | |
virtual bool | Script_ContainsCommand (string commandName) |
Returns true if the internal script's interpreter contains a command with specified name, false otherwise. More... | |
virtual bool | Script_ContainsScriptCommand (string commandName) |
Returns true if the specified command is script command (i.e. its first argument is command-name and it is run through the Script_CommandAdapter object). More... | |
virtual void | Script_RemoveCommand (string commandName) |
Removes the specified internal script command from the internal interpreter of the current scripting object. More... | |
virtual void | Script_RemoveAllCommands () |
Removes ALL internal script commands from the internal interpreter of the current scripting object. More... | |
string | Script_Run (string[] arguments) |
Runs internal script command. More... | |
string | Script_Run (string commandName, params string[] otherArguments) |
Runs internal script command. More... | |
virtual void | Script_PrintArguments (string messageString, string[] arguments) |
Prints the specified array of string arguments (usually passed as command-line arguments). More... | |
Public Attributes | |
const string | ConstTest = "Test" |
Comamnd name for test. More... | |
const string | ConstHelpTest = "Test of functionality." |
const string | ConstCustom = "Custom" |
Comamnd name for test. More... | |
const string | ConstHelpCustom = "Custom command that can be quickly modified as needed, for performing." |
const string | ConstRunParallel = "RunParallel" |
Comamnd name for running parallel simulations. More... | |
const string | ConstHelpRunParallel = "Runs parallel simulations. Args: numThreads numRunsPerThread" |
const string | ConstCollectParallel = "collectparallel" |
Comamnd name for running parallel simulations. More... | |
const string | ConstHelpCollectParallel = "Collects results of parallel simulations. Args: numThreads" |
const string | ConstCreateDistortedModelData = "CreateDistortedModelData" |
Comamnd name for testing network response for centered point from verification or training points for all Inputs/outputs. More... | |
const string | ConstHelpCreateDistortedModelData |
string | ParallelResultsFilename = "ParallelResults" |
int | ParSimNumRuns = 2 |
Number of runs of simulator in each parallel thread. More... | |
int | ParSimNumThreads = 2 |
Number of jobs that can be executed in parallel. More... | |
int | ParSimSavingFrequency = 4 |
Specifies how often the results are saved. More... | |
string | ParSimResultFilename = "GatheredNeuralTrainingData.json" |
bool | saveGraphs = false |
Public Attributes inherited from IG.Lib.LoadableScriptBase | |
const string | ConstDefaultHelp = "Help" |
Default command name for help. More... | |
const string | ConstHelpDefaultUniversal = "?" |
Universal name of the help command. More... | |
const string | ConstDefaultTestScrip = "TestScript" |
Default command name for test method. More... | |
Static Public Attributes | |
static string | TrainedNetworkAlternativeLovation = null |
If different than null, this static property provides alternative location of the file which neural network approximator is resd from, in terms of path relative to optimization directory. More... | |
Protected Member Functions | |
override void | InitializeThis (string[] arguments) |
Inializes the current script object. More... | |
virtual void | LoadJson (string path, ref INeuralApproximator network) |
Loads the neural network approximator from the specified file. More... | |
virtual void | SaveJson (INeuralApproximator approximator, string trainedNetworkFilePath) |
Saves the specified trained network to a file. More... | |
virtual INeuralApproximator | CreateApproximator (int annType=2) |
Creates and returns a new neural network approximator, with the basic properties pre-set to default values, dependent on the type of the requires approximator. More... | |
virtual void | PrintInternalCommandAndArguments (string[] arguments) |
Prints internal command being executed and its actual arguments More... | |
virtual void | GetSimulationInputDefault (ref IVector result) |
Gets the vector of default values of simulation parameters and stores it in the specified vector. More... | |
virtual void | GetSimulationInputMin (ref IVector result) |
Gets the vector of lower bounds on simulation parameters and stores it in the specified vector. More... | |
virtual void | GetSimulationInputMax (ref IVector result) |
Gets the vector of upper bounds on simulation parameters and stores it in the specified vector. More... | |
virtual void | ParSimPrepareDirectories (int numThreads) |
Prepares data for the specified number of parallel execution threads. More... | |
virtual void | ParSimWaitAllCompletion () |
Waits until all parallel jobs complete. More... | |
virtual void | ParSimAsyncCallback (IAsyncResult ar) |
Callback method for asynchronous runs. More... | |
virtual string | ParSimGetDirectoryExtension (int threadIndex) |
Returns directory extension for data directory used in the specified parallel calculation thread. More... | |
virtual void | GetNeuralInputDefault (ref IVector result) |
Gets the vector of default values of neural parameters and stores it in the specified vector. More... | |
virtual void | GetNeuralInputMin (ref IVector result) |
Gets the vector of lower bounds on neural parameters and stores it in the specified vector. More... | |
virtual void | GetNeuralInputMax (ref IVector result) |
Gets the vector of upper bounds on neural parameters and stores it in the specified vector. More... | |
virtual void | GetRandomNeuralInputFromDataDefinition (IRandomGenerator rand, ref IVector result) |
Generates a random vector of neural input parameters whose elements (components) lie within the lower and upper bounds on parameters, and stores it to the specified vector. More... | |
Protected Member Functions inherited from IG.Lib.LoadableScriptShellBase | |
virtual void | CreateNewSimulator (string simulatorPath, ref IResponseEvaluatorVectorSimple simulator) |
Creates a new simulator that uses the specified simulator directory, and stores it to the specified variable. More... | |
Protected Member Functions inherited from IG.Lib.LoadableScriptBase | |
delegate string | CommandMethod (string commandName, string[] args) |
Delegate for internal command methods. More... | |
abstract string | RunThis (string[] arguments) |
Performs the action of this object. Override this in derived classes! More... | |
ICommandLineApplicationInterpreter | Script_CreateInterpreter () |
Creates and returns an interpreter that can be used as script's internal interpreter for running script's commands. More... | |
virtual string | Script_CommandHelp (string[] arguments) |
Prints help. More... | |
virtual string | Script_CommandTestScript (string[] arguments) |
Prints help. More... | |
Properties | |
abstract int | NumOptimizationParameters [get, protected set] |
Number of optimization parameters. More... | |
abstract int | NumOptimizationConstraints [get, protected set] |
Number of optimization constraints. More... | |
virtual InputOutputDataDefiniton | SimulationDataDefinition [get] |
Simulation data definition (input and output used by simulator). More... | |
virtual int | NumSimulationParameters [get, protected set] |
Number of simulation input parameters. More... | |
virtual int | NumSimulationOutputs [get, protected set] |
Number of simulation output values. More... | |
virtual IBoundingBox | SimulationInputBounds [get, protected set] |
Bounds on simulation input parameters. More... | |
string | ParallelResultsFileExtension [get, protected set] |
virtual NeuraApproximationFileManager | NeuralFM [get] |
File manager that provides access to trained neural network and related data. More... | |
virtual INeuralApproximator | TrainedNetwork [get, protected set] |
Trained neural network. More... | |
virtual List< IVector > | SensitivityVerificationResults [get, protected set] |
virtual List< IVector > | SensitivityTrainingResults [get, protected set] |
virtual INeuralApproximator | XXX_TrainedNetwork [get, protected set] |
Trained neural network. More... | |
virtual InputOutputDataDefiniton | NeuralDataDefinition [get, protected set] |
Neural data definition. More... | |
virtual SampledDataSet | TrainingData [get, set] |
virtual SampledDataSet | VerificationData [get, set] |
virtual int | NumNeuralParameters [get, protected set] |
Number of neural network input parameters. More... | |
virtual int | NumNeuralOutputs [get, protected set] |
Number of neural network output values. More... | |
virtual IBoundingBox | NeuralInputBounds [get, protected set] |
Bounds on neural input parameters. More... | |
virtual SampledDataSet | NeuralTrainingData [get] |
Gets the training data. More... | |
virtual int | NumAllTrainingPoints [get] |
Gets number of all training points, including verification points. More... | |
virtual IVector | SomeNeuralInput [get] |
Returns some vector of input parameters that is within the range. More... | |
virtual IVector | NeuralInputFromFile [get] |
Vector of input parameters read form the file. More... | |
Properties inherited from IG.Lib.LoadableScriptShellBase | |
abstract IResponseEvaluatorVectorSimple | Simulator [get, protected set] |
Simulator that is used to calculate vector response. More... | |
virtual bool | SimulatorSuppressOutput [get, set] |
A flag indicating whether simulators should suppress output or not, default is false. More... | |
virtual string | ProjectName [get, protected set] |
Name of the current project, used in some simulation and other interfaces. More... | |
virtual string | SimulationName [get, protected set] |
Name of the current simulation, used in some simulation and other interfaces. More... | |
Properties inherited from IG.Lib.LoadableScriptOptShellBaseControllable | |
bool | IsLoadable [get, set] |
Either or not the script can be dynamically loaded. More... | |
bool | IsRunnable [get, set] |
Either or not the script can be run (some scripts only support other tasks). More... | |
Properties inherited from IG.Lib.LoadableScriptOptBase | |
StopWatch1 | Timer [get] |
virtual IRandomGenerator | Random [get, protected set] |
Random generator used by the current object. More... | |
virtual string | OptimizationDirectory [get, set] |
Optimization directory. This directory is a base directory for data used optimization and neural network - based approximation servers and for other directories that contain data for specific tasks. More... | |
virtual string | WorkingDirectory [get, set] |
Working directory. This directory is a base directory for data used by the script. It is usually obtained as parent directory of the optimization directory. More... | |
virtual IAnalysis | Analysis [get, protected set] |
Direct analysis object used in optimization. Initialized when first accessed with the embedded class, whose analysis function calls Analyse(...). More... | |
Properties inherited from IG.Lib.LoadableScriptBase | |
string | EmbeddedCommandName [get, set] |
Command that was used to launch the current embedded application script. More... | |
object | Lock [get] |
This object's central lock object to be used by other object. Do not use this object for locking in class' methods, for this you should use InternalLock. More... | |
string[] | InitializationArguments [get, set] |
Arguments used by the initialization method. WARNING: arguments can only be set before initialization is performed. Initialization is performed either implicitly at the first call to the Run method or explicitly by calling the Initialize method. More... | |
virtual bool | IsInitialized [get, protected set] |
Whether the object has been initialized or not. More... | |
static int | DefaultOutputLevel [get, set] |
int | OutputLevel [get, set] |
Level of output to console produced by some operations of the current object. More... | |
virtual ICommandLineApplicationInterpreter | Script_Interpreter [get, protected set] |
Script's internal interpreter that takes care for execution of installed internal commands. More... | |
SortedList< string, string > | Script_CommandHelpStrings [get] |
Contains help strings associated with script commands installed on interpreter. More... | |
Properties inherited from IG.Lib.ILoadableScript | |
string | EmbeddedCommandName [get, set] |
Command that was used to launch the current embedded application script. More... | |
string[] | InitializationArguments [get, set] |
Arguments used by the initialization method. More... | |
bool | IsInitialized [get] |
Whether the object has been initialized or not. More... | |
Properties inherited from IG.Lib.ILockable | |
object | Lock [get] |
Properties inherited from IG.Lib.ILoadableScriptC | |
bool | IsLoadable [get, set] |
Either or not the script can be dynamically loaded. More... | |
bool | IsRunnable [get, set] |
Either or not the script can be run (some scripts only support other tasks). More... | |
Properties inherited from IG.Num.INeuralModel | |
INeuralApproximator | TrainedNetwork [get] |
Traint artificial neural network. More... | |
InputOutputDataDefiniton | NeuralDataDefinition [get] |
Neural data definition. More... | |
Base class for loadable scripts that are used as custom applications that inclued neural networks approximations and optimization.
This is an abstract class. Derived class LoadableScriptShellNeural serves the same purpose and is concrete (but some implementations just throw exceptions).
$A Igor xx Jul11 Dec12 Feb12;
|
inline |
|
inlineprotectedvirtual |
Inializes the current script object.
arguments | Initialization arguments. The first argument must be the working directory path. |
Reimplemented from IG.Lib.LoadableScriptShellBase.
|
inlineprotectedvirtual |
Loads the neural network approximator from the specified file.
In the derived classes, this method can be overridden in order to handle more types of neurel network approximators.
path | File path. |
network | Neual network into which loaded data is restored. |
References IG.Num.NeuralApproximatorBase.LoadJson().
|
inlineprotectedvirtual |
Saves the specified trained network to a file.
This method hould be
approximator | Trained neural network to be saved. |
trainedNetworkFilePath | Path of the file into which trained neural network is saved in JSON form. |
References IG.Num.NeuralApproximatorBase.SaveJson().
|
inlineprotectedvirtual |
Creates and returns a new neural network approximator, with the basic properties pre-set to default values, dependent on the type of the requires approximator.
This methods should be overridden in derived classes in order to allow use of other neural approximatiors.
annType | Type of the neural network approximator: |
1 - NeuralApproximatorNeuron (only availeble in more specialized libraries for internal use).
2 - NeuralApproximatorAforge (basic neural network approximator in this library).
References IG.Num.INeuralApproximator.InputNeuronsRange, IG.Num.INeuralApproximator.OutputNeuronsRange, IG.Num.IBoundingBox.Reset(), IG.Num.INeuralApproximator.SigmoidAlphaValue, and IG.Num.IBoundingBox.UpdateAll().
|
inline |
Dummy analysis, jsut throws the exception.
anRes |
NotImplementedException
|
inlineprotectedvirtual |
Prints internal command being executed and its actual arguments
arguments | Script run arguments, the first one is command name. |
|
inlinevirtual |
Runs a custom basic test.
In its current variants, it jus prints some data about important directories, etc.
arguments | Command arguments, first one (index 0) is always command name. |
|
inlinevirtual |
Runs a custom test.
arguments | Command arguments, first one (index 0) is always command name. |
This command is reserved for quick custom tests whose code will change frequently. In general, you should override the command code in the derived classes if you need this functionality.
References IG.Num.NeuralTrainingParameters.LearningRate.
|
inlinevirtual |
Runs multiple simulations in parallel threads and saves results in each parallel thread.
arguments | Command arguments, first one (index 0) is always command name. |
|
inlinevirtual |
Collects results of simulations run in parallel threads, joins them into a single object and saves them.
arguments | Command arguments. |
|
inlinevirtual |
Adds commands to the internal interpreter.
interpreter | Interpreter where commands are executed. |
helpStrings | List containg help strings. |
Reimplemented from IG.Lib.LoadableScriptBase.
|
inlinevirtual |
Performs a test approximation at the specified vector of parameters and outputs and returns results.
parameters | Parameters at which approximation output vector is calculated. |
References IG.Lib.StopWatch1.CpuTime, IG.Lib.StopWatch1.Start(), IG.Lib.StopWatch1.Stop(), IG.Lib.StopWatch1.Time, and IG.Num.IVector.ToString().
|
inlinevirtual |
Calculates a table of specified number of approximations, with parameters running between two points that are chosen by the algorithm.
numPoints | Number of points in which approximation results results are calculated. |
|
inlinevirtual |
Performs a table of approximatinos between two specified vectors of approximation input parameters, and outputs results. It also returns the table of results (approximated output values in form of vectors).
Approximations are performed in specified number of equidistant points between the two specified vectors of input parameters.
param1 | The first vector of approximation input parameters. |
param2 | The second vector of approximation input parameters. |
numPoints | Number of points where calculations (approximations) are perfomed, must be at least two. |
References IG.Num.VectorBase.Add(), IG.Num.VectorBase.Copy(), IG.Lib.StopWatch1.CpuTime, IG.Num.VectorBase.Multiply(), IG.Lib.StopWatch1.Start(), IG.Lib.StopWatch1.Stop(), IG.Num.VectorBase.Subtract(), and IG.Lib.StopWatch1.Time.
|
inlinevirtual |
Performs test analysis at the specified optimization parameters and outputs results.
Analysis results are returned, too.
parameters | Optimization parameters at which the analysis is performed. |
References IG.Lib.StopWatch1.CpuTime, IG.Num.AnalysisResults.GetConstraint(), IG.Num.AnalysisResults.NumConstraints, IG.Num.AnalysisResults.NumParameters, IG.Num.AnalysisResults.Objective, IG.Num.AnalysisResults.Parameters, IG.Num.AnalysisResults.ReqObjective, IG.Lib.StopWatch1.Start(), IG.Lib.StopWatch1.Stop(), IG.Lib.StopWatch1.Time, IG.Num.IVector.ToString(), and IG.Num.AnalysisResults.ToString().
|
inlinevirtual |
Calculates a table of specified number of analyses, with parameters running between two points that are chosen by the algorithm.
numPoints | Number of points in which analysis results are calculated. |
|
inlinevirtual |
Performs a table of direct analyses between two specified vectors of optimization parameters, and outputs results. It also returns the table of analysis results.
Analyses are performed in specified number of equidistant points between the two specified vectors of parameters.
param1 | The first vector of parameters. |
param2 | The second vector of parameters. |
numPoints | Number of analyses perfomed, must be at least two. |
References IG.Num.VectorBase.Add(), IG.Num.VectorBase.Copy(), IG.Lib.StopWatch1.CpuTime, IG.Num.VectorBase.Multiply(), IG.Lib.StopWatch1.Start(), IG.Lib.StopWatch1.Stop(), IG.Num.VectorBase.Subtract(), and IG.Lib.StopWatch1.Time.
|
inlinevirtual |
|
inlinevirtual |
Maps input parameters for neural network to optimization input parameters.
neuralParameters | Vector of neural network's input parameters. |
optimizationParameters | Vector where corresponding optimization parameters are written. Reallocated if necessary. |
|
inlinevirtual |
Maps optimization input parameters to neural network input parameters.
optimizationParameters | Vector where corresponding optimization parameters are written. |
neuralParameters | Vector of neural network's input parameters. Reallocated if necessary. |
|
inlineprotectedvirtual |
Gets the vector of default values of simulation parameters and stores it in the specified vector.
result | Vector where result is stored. |
Elements of vector are obtained from data definition. If for some element default value is not defined then it is set to 0.
References IG.Num.VectorBase.Copy(), IG.Num.InputElementDefinition.DefaultValue, IG.Num.InputElementDefinition.DefaultValueDefined, IG.Num.InputOutputDataDefiniton.GetInputElement(), and IG.Num.InputOutputDataDefiniton.InputLength.
|
inlineprotectedvirtual |
Gets the vector of lower bounds on simulation parameters and stores it in the specified vector.
result | Vector where result is stored. |
Elements of vector are obtained from data definition. If for some element bound is not defined then it is set to double.MinValue
References IG.Num.InputOutputElementDefinition.BoundsDefined, IG.Num.VectorBase.Copy(), IG.Num.InputOutputDataDefiniton.GetInputElement(), IG.Num.InputOutputDataDefiniton.InputLength, and IG.Num.InputOutputElementDefinition.MinimalValue.
|
inlineprotectedvirtual |
Gets the vector of upper bounds on simulation parameters and stores it in the specified vector.
result | Vector where result is stored. |
Elements of vector are obtained from data definition. If for some element bound is not defined then it is set to double.MaxValue
References IG.Num.InputOutputElementDefinition.BoundsDefined, IG.Num.VectorBase.Copy(), IG.Num.InputOutputDataDefiniton.GetInputElement(), IG.Num.InputOutputDataDefiniton.InputLength, and IG.Num.InputOutputElementDefinition.MaximalValue.
delegate string IG.Script.LoadableScriptShellNeuralBase.ParallelRunDelegate | ( | int | threadIndex | ) |
|
inlineprotectedvirtual |
Prepares data for the specified number of parallel execution threads.
numThreads | Number of parallel threads for which data is prepared. |
|
inlineprotectedvirtual |
Waits until all parallel jobs complete.
It is necessary to execute this in the main thread because ending of the main thread would kill all parallel threads (jobs are executed in background threads via async. invoke mechanism).
|
inlinevirtual |
Launches parallel jobs.
numThreads | Number of parallel threads for which data is prepared. |
|
inlinevirtual |
Reads results form all parallel threads, gathers them in a single training set, and saves them in the template optimiation directory.
References IG.Num.SampledDataSet.GetNumInputDuplicates(), IG.Num.SampledDataSet.GetNumNullElemets(), IG.Num.SampledDataSet.Length, IG.Num.SampledDataSet.RemoveInputDuplicates(), and IG.Num.SampledDataSet.SaveJson().
|
inlineprotectedvirtual |
Callback method for asynchronous runs.
ar | Asynchronous results that are passed to the method. |
|
inlineprotectedvirtual |
Returns directory extension for data directory used in the specified parallel calculation thread.
threadIndex | Index of the parllel calculation thread and corresponding data directory. |
|
inlinevirtual |
Returns path to the directory containing optimization data for the specified parallel thread.
threadIndex | Index of parallel calculation thread for which the directory is returned. |
References IG.Lib.UtilSystem.StandardizeDirectoryPath().
|
inlinevirtual |
Returns name of the mutex for locking data on disk that is used by the specified parallel thread.
threadIndex | Index (internal) of thread for which mutex name is obtained. |
|
inlinevirtual |
Returns path of the file where resuls of calculation in the specified parallel thread are stored.
threadIndex | Index of the parallel thread. |
|
inlinevirtual |
Returns path of the file where resuls of calculation in the specified parallel thread are stored.
threadIndex | Index of the parallel thread. |
|
inlinevirtual |
Prepares data for running calculations in the parallel thread with the specified index.
threadIndex |
References IG.Lib.UtilSystem.CopyDirectory().
|
inline |
Reads results of the specified thread and adds them to the existing training set.
threadIndex | Index of the thread. |
results | Training results to which results are added. |
References IG.Num.SampledDataSet.AddElement(), IG.Num.SampledDataSet.Length, IG.Num.SampledDataSet.LoadJson(), and IG.Num.SampledDataElement.OutputValues.
|
inline |
Runs the job in the specified parallel thread.
threadIndex | Index of the parallel thread. |
References IG.Num.SampledDataSet.AddElement(), IG.Num.SampledDataSet.SaveJson(), IG.Lib.StopWatch1.Start(), IG.Lib.StopWatch1.Stop(), and IG.Lib.StopWatch1.Time.
|
inlinevirtual |
Generates the next vector of simulation input parameters that will be used for calculation of a new parallel simulation.
Vector of neural input parameters is generated first by ParSimGetNextNeuralInput, then neural parameters are tansformed to simulation parameters.
|
inlinevirtual |
Generates the next vector of neural input parameters that will be used for calculation of a new training element.
|
inlinevirtual |
Returns the simulation directory for the specified parallel calculation thread.
threadIndex | Index of parallel calculation thread for which the directory is returned. |
|
inlinevirtual |
Creates simulator file manager for the simulator that will the specified parallel task.
threadIndex | Index of parallel task and its corresponding data directory. |
<remeremarks>Derived classes that implement parallel execution of simulators for generating training data eill either override this method, or mor conveniently the CreateNewSimulator method that is called from this method.</remeremarks>
|
pure virtual |
Transforms the specified vector of simulation input parameters to the vector of neural input parameters and stores the vector to the specified variable.
original | Vector to be transformed. |
result | Vector where result of transformation is stored. |
Implemented in IG.Script.LoadableScriptShellNeural.
|
inlinevirtual |
Transforms the specified vector of neural input parameters to the vector of simulation input parameters and stores the vector to the specified variable.
original | Vector to be transformed. |
result | Vector where result of transformation is stored. |
Reimplemented in IG.Script.LoadableScriptShellNeural.
|
inlinevirtual |
Transforms the specified vector of simulation output values (results) to the vector of neural output values and stores the vector to the specified variable.
original | Vector to be transformed. |
result | Vector where result of transformation is stored. |
Reimplemented in IG.Script.LoadableScriptShellNeural.
|
inlinevirtual |
Transforms the specified vector of neural output values to the vector of simulation output values (results) and stores the vector to the specified variable.
original | Vector to be transformed. |
result | Vector where result of transformation is stored. |
Reimplemented in IG.Script.LoadableScriptShellNeural.
|
inlineprotectedvirtual |
Gets the vector of default values of neural parameters and stores it in the specified vector.
result | Vector where result is stored. |
Elements of vector are obtained from data definition. If for some element default value is not defined then it is set to 0.
References IG.Num.VectorBase.Copy(), IG.Num.InputElementDefinition.DefaultValue, IG.Num.InputElementDefinition.DefaultValueDefined, IG.Num.InputOutputDataDefiniton.GetInputElement(), and IG.Num.InputOutputDataDefiniton.InputLength.
|
inlineprotectedvirtual |
Gets the vector of lower bounds on neural parameters and stores it in the specified vector.
result | Vector where result is stored. |
Elements of vector are obtained from data definition. If for some element bound is not defined then it is set to double.MinValue
References IG.Num.InputOutputElementDefinition.BoundsDefined, IG.Num.VectorBase.Copy(), IG.Num.InputOutputDataDefiniton.GetInputElement(), IG.Num.InputOutputDataDefiniton.InputLength, and IG.Num.InputOutputElementDefinition.MinimalValue.
|
inlineprotectedvirtual |
Gets the vector of upper bounds on neural parameters and stores it in the specified vector.
result | Vector where result is stored. |
Elements of vector are obtained from data definition. If for some element bound is not defined then it is set to double.MaxValue
References IG.Num.InputOutputElementDefinition.BoundsDefined, IG.Num.VectorBase.Copy(), IG.Num.InputOutputDataDefiniton.GetInputElement(), IG.Num.InputOutputDataDefiniton.InputLength, and IG.Num.InputOutputElementDefinition.MaximalValue.
|
inlinevirtual |
Gets the training element with the specified index (chosen out of al training points, including verificaion points).
|
inlinevirtual |
Whether the training point with the specified index is a verification points and has not been used in training.
|
inline |
Returns a list of all neural training elements.
The returned list is created anew.
includeVerificationPoints | Flag indicating whether verification points are also included in the returned list. |
|
inline |
Returns a list of all neural training elements.
The returned list is created anew.
includeVerificationPoints | Flag indicating whether verification points are also included in the returned list. |
includeNonVerificationPoints | Flag indicating whether non-verification points are included in the returned list. |
|
inlinevirtual |
Returns a perturbance vector whose componenets represent magnitudes of perturbances of neural input parameters with the specified relative ratio with corresponding parameters' scaling lengths.
ratio | Ratio between perturbance component and scaling length of each parameter. |
Scaling length is either the difference between maximal and minimal value, or 0.
perturbance | Vector where perturbance magnitudes are stored. |
References IG.Num.InputOutputElementDefinition.BoundsDefined, IG.Num.InputOutputElementDefinition.MaximalValue, and IG.Num.InputOutputElementDefinition.MinimalValue.
|
inlinevirtual |
Returns a perturbance vector whose componenets represent magnitudes of perturbances of neural output values with the specified relative ratio with corresponding values' scaling lengths.
ratio | Ratio between perturbance component and scaling length of each value. |
Scaling length is either the difference between maximal and minimal value, or 0.
perturbance | Vector where perturbance magnitudes are stored. |
References IG.Num.InputOutputElementDefinition.BoundsDefined, IG.Num.InputOutputElementDefinition.MaximalValue, and IG.Num.InputOutputElementDefinition.MinimalValue.
|
inlinevirtual |
Returns an input vector whose components are at specified relative distances (with respect to full range) from lower bounds on componens of input vectors.
relativeComponents | Relative coordinate of all vector components of the returned vector, which run from 0 to 1 within the range of components (defined by minimal and maximal bounds). |
inputVector | Object where generated vector is stored. |
References IG.Num.InputOutputElementDefinition.BoundsDefined, IG.Num.InputOutputElementDefinition.MaximalValue, and IG.Num.InputOutputElementDefinition.MinimalValue.
|
inlinevirtual |
Returns an output vector whose components are at specified relative distances (with respect to full range) from lower bounds on componens of input vectors.
relativeComponents | Relative coordinate of all vector components of the returned vector, which run from 0 to 1 within the range of components (defined by minimal and maximal bounds). |
inputVector | Object where generated vector is stored. |
References IG.Num.InputOutputElementDefinition.BoundsDefined, IG.Num.InputOutputElementDefinition.MaximalValue, and IG.Num.InputOutputElementDefinition.MinimalValue.
|
inlinevirtual |
Returns an input vector whose components are at specified relative distances (with respect to full range) from lower bounds on componens of input vectors.
relativeComponents | Relative coordinates of all vector components of the returned vector, which run from 0 to 1 within the range of components (defined by minimal and maximal bounds). |
inputVector | Object where generated vector is stored. |
References IG.Num.InputOutputElementDefinition.BoundsDefined, IG.Num.InputOutputElementDefinition.MaximalValue, and IG.Num.InputOutputElementDefinition.MinimalValue.
|
inlinevirtual |
Returns an output vector whose components are at specified relative distances (with respect to full range) from lower bounds on componens of input vectors.
relativeComponents | Relative coordinates of all vector components of the returned vector, which run from 0 to 1 within the range of components (defined by minimal and maximal bounds). |
inputVector | Object where generated vector is stored. |
References IG.Num.InputOutputElementDefinition.BoundsDefined, IG.Num.InputOutputElementDefinition.MaximalValue, and IG.Num.InputOutputElementDefinition.MinimalValue.
|
inlinevirtual |
Calculates relative components (running from 0 to 1 within bounds for specified vector component) for the specified vector of neural input parameters.
inputVector | Vector of input parameters for neural network. |
relativeComponents | Vector where transformed relative components of the specified vector are stored. |
References IG.Num.InputOutputElementDefinition.BoundsDefined, IG.Num.InputOutputElementDefinition.MaximalValue, and IG.Num.InputOutputElementDefinition.MinimalValue.
|
inlinevirtual |
Calculates relative components (running from 0 to 1 within bounds for specified vector component) for the specified vector of neural output values.
outputVector | Vector of output values in neural network approximator's output space. |
relativeComponents | Vector where transformed relative components of the specified vector are stored. |
References IG.Num.InputOutputElementDefinition.BoundsDefined, IG.Num.InputOutputElementDefinition.MaximalValue, and IG.Num.InputOutputElementDefinition.MinimalValue.
|
inlinevirtual |
Returns measure of distance between two vectors in the space of input parameters. Euclidean norm scaled accorging to individual parameter ranges is returned.
References IG.Num.InputOutputElementDefinition.BoundsDefined, IG.Num.InputOutputDataDefiniton.GetInputElement(), IG.Num.InputOutputDataDefiniton.InputLength, IG.Num.InputOutputElementDefinition.MaximalValue, and IG.Num.InputOutputElementDefinition.MinimalValue.
|
inlinevirtual |
Returns measure of distance between two vectors in the space of output parameters. Euclidean norm scaled accorging to individual parameter ranges is returned.
References IG.Num.InputOutputElementDefinition.BoundsDefined, IG.Num.InputOutputDataDefiniton.GetOutputElement(), IG.Num.InputOutputElementDefinition.MaximalValue, IG.Num.InputOutputElementDefinition.MinimalValue, and IG.Num.InputOutputDataDefiniton.OutputLength.
|
inlinevirtual |
Returns measure of distance between the specified neural input vector and vector of input parameters of the training point with the specified index.
v1 | First vector in space of input parameter for calculating distance. |
trainingPointIndex | Index of training point for obtaining the second input vector. |
|
inlinevirtual |
Returns measure of distance between the specified neural output values vector and vector of output values of the training point with the specified index.
v1 | First vector in space of output values for calculating distance. |
trainingPointIndex | Index of training point for obtaining the second output vector. |
|
inlinevirtual |
Returns index of training element with the shortest distance of its input parameters to the specified vector.
v1 | Vector to which the distance is observed. |
countVerificationPoints | Whether verification points are included or not. |
|
inlinevirtual |
Returns index of training element with the shortest distance of its output values to the specified vector of output values.
v1 | Vector to which the distance is observed. |
countVerificationPoints | Whether verification points are included or not. |
|
inline |
For each point in the specified array, the training points are sorted according to the distance to this point, and data for the specified number of closest points are written.
Result of this test can give some rough feeling about filling of space (but very rough because anisotropy can not be detected in this way).
numClosestPoints | Number of closest points that are written. |
includeVerificationPoints | Whether verification points are included or not. |
printByComponents | If true then results are also printed by components. |
points | Points that are checked for closest trainnig data points. |
|
inline |
For each point in the specified array, the training points are sorted according to the distance to this point, and data for the specified number of closest points are written.
For individual points, differences are not printed by components.
Result of this test can give some rough feeling about filling of space (but very rough because anisotropy can not be detected in this way).
numClosestPoints | Number of closest points that are written. |
includeVerificationPoints | Whether verification points are included or not. |
printByComponents | If true then results are also printed by components. |
printIndividualPointsComp | If true then individual components of differences are printed for individual points (otherwise, they are only printed in statistics). |
points | Points that are checked for closest trainnig data points. |
References IG.Num.SampledDataElement.Index, IG.Num.SampledDataElement.InputParameters, IG.Lib.StopWatch1.Start(), IG.Lib.StopWatch1.Stop(), IG.Num.VectorBase.Subtract(), IG.Lib.StopWatch1.Time, IG.Num.IVector.ToString(), and IG.Lib.StopWatch1.TotalTime.
|
inline |
For each point (training element) in the specified array, the training points are sorted according to the distance to this point, and data for the specified number of closest points are written.
For individual points, differences are not printed by components.
Result of this test can give some rough feeling about filling of space (but very rough because anisotropy can not be detected in this way).
numClosestPoints | Number of closest points that are written. |
includeVerificationPoints | Whether verification points are included or not. |
printByComponents | If true then results are also printed by components. |
points | Points that are checked for closest trainnig data points. |
|
inline |
For each point (training element) in the specified array, the training points are sorted according to the distance to this point, and data for the specified number of closest points are written.
Result of this test can give some rough feeling about filling of space (but very rough because anisotropy can not be detected in this way).
numClosestPoints | Number of closest points that are written. | ||
includeVerificationPoints | Whether verification points are included or not. | ||
printByComponents | If true then results are also printed by components. | ||
printIndividualPoints | If true then individual components of differences are printed for
|
References IG.Num.SampledDataElement.Index, IG.Num.SampledDataElement.InputParameters, IG.Num.SampledDataElement.OutputValues, IG.Lib.StopWatch1.Start(), IG.Lib.StopWatch1.Stop(), IG.Num.VectorBase.Subtract(), IG.Lib.StopWatch1.Time, IG.Num.IVector.ToString(), and IG.Lib.StopWatch1.TotalTime.
|
inlinevirtual |
Calculates approximation at specified input parameters.
inputParameters | Input parameters. |
|
inlinevirtual |
Calculates approximation at specified input parameters.
inputParameters | Input parameters. |
|
inlinevirtual |
Calculates approximation at specified input parameters.
inputParameters | Input parameters. |
|
inlinevirtual |
Creates and returns a list of training elements that are randomly chosen from the current training set. Trainingpoints that are not verification points are always included in the set of points for selection.
The global random generator is used to select training elements.
numElements | Number of elemnts that are randomly selected and put into the returned list. If the number of all available elements is smaller than this number then exception is thrown. |
includeVerificationPoints | A flag indicationg whether verification elements should also be included. |
|
inlinevirtual |
Creates and returns a list of training elements that are randomly chosen from the current training set.
The global random generator is used to select training elements.
numElements | Number of elemnts that are randomly selected and put into the returned list. If the number of all available elements is smaller than this number then exception is thrown. |
includeVerificationPoints | A flag indicationg whether verification elements should also be included. |
includeNonVerificationPoints | A flag indicating whether non-verification elements should be included in the list. |
|
inlinevirtual |
Creates and returns a list of training elements that are randomly chosen from the current training set. Trainingpoints that are not verification points are always included in the set of points for selection.
rand | Random generator used for random selection of training elements. |
numElements | Number of elemnts that are randomly selected and put into the returned list. If the number of all available elements is smaller than this number then exception is thrown. |
includeVerificationPoints | A flag indicationg whether verification elements should also be included. |
|
inlinevirtual |
Creates and returns a list of training elements that are randomly chosen from the current training set.
rand | Random generator used for random selection of training elements. |
numElements | Number of elemnts that are randomly selected and put into the returned list. If the number of all available elements is smaller than this number then exception is thrown. |
includeVerificationPoints | A flag indicationg whether verification elements should also be included. |
includeNonVerificationPoints | A flag indicating whether non-verification elements should be included in the list. |
References IG.Num.IRandomGenerator.Next().
|
inlinevirtual |
Creates and returns a random vector of neural input parameters whose elements (components) lie within the lower and upper bounds on parameters.
Global random generator is used to generate vecor components.
|
inlinevirtual |
Generates a random vector of neural input parameters whose elements (components) lie within the lower and upper bounds on parameters, and stores it to the specified vector.
rand | Random number generator used to generate the elements. |
result | Vector object whre the generated random vector is stored; allocated if necessary. |
|
inlinevirtual |
Creates and returns a random vector of neural input parameters whose elements (components) lie within the lower and upper bounds on parameters.
rand | Random number generator used to generate the elements. |
|
inlinevirtual |
Generates a random vector of neural input parameters whose elements (components) lie within the lower and upper bounds on parameters.
|
inlineprotectedvirtual |
Generates a random vector of neural input parameters whose elements (components) lie within the lower and upper bounds on parameters, and stores it to the specified vector.
rand | Random number generator used to generate the elements. |
result | Vector object whre the generated random vector is stored; allocated if necessary. |
References IG.Num.InputOutputElementDefinition.BoundsDefined, IG.Num.InputOutputElementDefinition.MaximalValue, IG.Num.InputOutputElementDefinition.MinimalValue, and IG.Num.IRandomGenerator.NextDouble().
|
inlinevirtual |
Creates and returns a random vector of neural output values whose elements (components) lie within the lower and upper bounds on values.
Global random generator is used to generate vecor components.
|
inlinevirtual |
Creates and returns a random vector of neural output values whose elements (components) lie within the lower and upper bounds on values.
rand | Random number generator used to generate the elements. |
|
inlinevirtual |
Generates a random vector of neural output values whose elements (components) lie within the lower and upper bounds on values.
|
inlinevirtual |
Generates a random vector of neural output values whose elements (components) lie within the lower and upper bounds on neural output values, and stores it to the specified vector.
rand | Random number generator used to generate the elements. |
result | Vector object whre the generated random vector is stored; allocated if necessary. |
References IG.Num.InputOutputElementDefinition.BoundsDefined, IG.Num.InputOutputElementDefinition.MaximalValue, IG.Num.InputOutputElementDefinition.MinimalValue, and IG.Num.IRandomGenerator.NextDouble().
|
inlinevirtual |
Prepares table of neurons in geometric sequence.
minNeurons | Minimum number of neurons. |
maxNeurons | Maximum number of neurons. |
numNeurons | Number of neurons in sequence. |
neurpnsTable | Table of neurons. |
$A Tako78 Nov12;
References IG.Num.GridGenerator1dBase.CoordinateFirst, IG.Num.GridGenerator1dBase.CoordinateLast, IG.Num.GridGenerator1dBase.GetNodeTable(), IG.Num.GridGenerator1d.GrowthFactor, and IG.Num.GridGenerator1dBase.NumNodes.
|
inline |
Train the artificial neural network.
annType | 1 - NeuronDotNet, 2 - Aforge. |
NumNeurons | Number of neirons in 1st hidden layer. |
MaxEpochs | Max epochs. |
EpochsInBundle | Epochs in bundle. |
LearnignRate | Learning rate. |
Momentum | Momentum. |
InputSafetyFactor | Input safety factor. |
OutputSafetyFactor | Output safety factor. |
PercentVerificationPoints | Percentage for verification points. |
References IG.Num.IVectorApproximator.CalculateOutput(), IG.Lib.SortedUniqueItemList< Type >.Contains(), IG.Lib.IndexList.CreateRandom(), IG.Num.INeuralApproximator.EpochsInBundle, IG.Num.SampledDataSet.GetInputParameters(), IG.Num.SampledDataSet.GetOutputValues(), IG.Num.INeuralApproximator.InputBoundsSafetyFactor, IG.Num.IVectorApproximator.InputLength, IG.Num.INeuralApproximator.LearningRate, IG.Num.SampledDataSet.LoadJson(), IG.Num.INeuralApproximator.MaxEpochs, IG.Num.INeuralApproximator.Momentum, IG.Num.INeuralApproximator.MultipleNetworks, IG.Num.INeuralApproximator.OutputBoundsSafetyFactor, IG.Num.IVectorApproximator.OutputLength, IG.Num.INeuralApproximator.OutputLevel, IG.Num.INeuralApproximator.SetHiddenLayers(), IG.Num.VectorBase.Subtract(), IG.Num.INeuralApproximator.ToleranceRms, IG.Num.IVector.ToString(), IG.Num.INeuralApproximator.TrainingData, IG.Num.INeuralApproximator.TrainNetwork(), and IG.Num.INeuralApproximator.VerificationIndices.
|
inlinevirtual |
Creates data for distorted model and stores the data in the specified directory.
Data of the current ANN model (read on demand from the standard locations of the model directory) is used as original data. The method chnages boundaries of input and output elements (eventually with the boundaries provided in a data definition file), creates and writes new data definition, then randomly samples the specified number of points by the original model, transforms input parameters and output values of hte transformed points in order to fit the new prescribed boundaries, and stores the new sampled data in the specified directory.
Ifthe directory where distorted model data is stored already exists, then the user is prompted whether to overwrite its contents or not.
arguments | Command arguments, first one (index 0) is always command name. |
Arguments are:
WorkingDirectory - working directory where the original model is found.
DistortedModelDirectory - directory where distorted model is stored. Specified as absolute path or relative to the current directory.
NumDataPoints - number of data points in the sampled data generated by the original model.
ChangeElementNames - optional, default false; whether data element names are changed.
ChangeTitlesAndDescriptions - optional, default true; whether element titles and descriptions are changed.
DataDefinitionFile - optional; data definition file for distorted model. If specified then new parameter bounds and other data (names, titles, descriptions, etc.) are taken from here, otherwise data is generated as necessary.
DistortionFactor - optional, default 2.5 - factor by which bounds are multiplied.
RandomFactor - ouptional, default 0.25 - mahnitude of additional random shiht of bounds (relative to distorted interval length).
References IG.Num.SampledDataSet.Add(), IG.Num.IVectorApproximator.CalculateOutput(), IG.Num.InputOutputDataDefiniton.Copy(), IG.Num.InputElementDefinition.DefaultValue, IG.Num.InputOutputElementDefinition.Description, IG.Num.InputElementDefinition.DiscretizationStep, IG.Num.InputOutputElementDefinition.GetDefaultInputElementDescription(), IG.Num.InputOutputElementDefinition.GetDefaultInputElementName(), IG.Num.InputOutputElementDefinition.GetDefaultInputElementTitle(), IG.Num.InputOutputElementDefinition.GetDistortedBounds(), IG.Num.InputOutputDataDefiniton.GetInputBounds(), IG.Num.InputOutputDataDefiniton.GetInputElement(), IG.Num.InputOutputDataDefiniton.GetOutputBounds(), IG.Num.InputOutputDataDefiniton.GetOutputElement(), IG.Num.InputOutputDataDefiniton.InputLength, IG.Num.InputOutputDataDefiniton.LoadJson(), IG.Num.BoundingBoxBase.Map(), IG.Num.InputOutputElementDefinition.MaximalValue, IG.Num.InputOutputElementDefinition.MinimalValue, IG.Num.InputOutputElementDefinition.Name, IG.Neural.NeuralFileConst.NeuralDataDefinitionFilename, IG.Neural.NeuralFileConst.NeuralTrainingDataFilename, IG.Neural.NeuralFileConst.NeuralVerificationDataFilename, IG.Num.InputElementDefinition.NumSamplingPoints, IG.Num.InputOutputDataDefiniton.OutputLength, IG.Lib.UtilConsole.Read(), IG.Num.SampledDataSet.SaveJson(), IG.Num.InputOutputDataDefiniton.SaveJson(), IG.Num.InputOutputElementDefinition.ScalingLength, IG.Num.InputOutputDataDefiniton.SetInputElement(), IG.Num.InputOutputDataDefiniton.SetOutputElement(), IG.Num.InputOutputElementDefinition.TargetValue, IG.Num.InputOutputElementDefinition.Title, and IG.Lib.Util.TryParseBoolean().
|
inlinevirtual |
Test of distances of a specified number of training points with respect to the training point with specified index, in the input parameters space as well as in the output parameter space.
referencePointIndex | Index of the point for which distances are calculated. |
maxNumPoints | Maximal number of points taken in the test. |
References IG.Num.IBoundingBox.GetMax(), and IG.Num.IBoundingBox.Update().
|
inlinevirtual |
Performs test of speed of calculation of neural network.
numEvaluations | Number of times the approximation is calculated. |
|
inlinevirtual |
This example demonstrates how to extract data necessary for definition of optimization problems.
References IG.Num.InputOutputElementDefinition.BoundsDefined, IG.Num.InputOutputElementDefinition.Description, IG.Num.InputOutputDataDefiniton.LoadJson(), IG.Num.InputOutputElementDefinition.MaximalValue, IG.Num.InputOutputElementDefinition.MinimalValue, IG.Num.InputOutputElementDefinition.Name, IG.Neural.NeuraApproximationFileManager.NeuralDataDefinitionPath, and IG.Num.InputOutputElementDefinition.TargetValue.
|
inline |
Saves sensitivity test in csv file.
$A Tako78 Jul13;
References IG.Lib.StringTable.AddRow(), IG.Lib.StringTable.SaveCsv(), and IG.Num.IVector.ToString().
const string IG.Script.LoadableScriptShellNeuralBase.ConstTest = "Test" |
Comamnd name for test.
const string IG.Script.LoadableScriptShellNeuralBase.ConstHelpTest = "Test of functionality." |
const string IG.Script.LoadableScriptShellNeuralBase.ConstCustom = "Custom" |
Comamnd name for test.
const string IG.Script.LoadableScriptShellNeuralBase.ConstHelpCustom = "Custom command that can be quickly modified as needed, for performing." |
const string IG.Script.LoadableScriptShellNeuralBase.ConstRunParallel = "RunParallel" |
Comamnd name for running parallel simulations.
const string IG.Script.LoadableScriptShellNeuralBase.ConstHelpRunParallel = "Runs parallel simulations. Args: numThreads numRunsPerThread" |
const string IG.Script.LoadableScriptShellNeuralBase.ConstCollectParallel = "collectparallel" |
Comamnd name for running parallel simulations.
const string IG.Script.LoadableScriptShellNeuralBase.ConstHelpCollectParallel = "Collects results of parallel simulations. Args: numThreads" |
const string IG.Script.LoadableScriptShellNeuralBase.ConstCreateDistortedModelData = "CreateDistortedModelData" |
Comamnd name for testing network response for centered point from verification or training points for all Inputs/outputs.
const string IG.Script.LoadableScriptShellNeuralBase.ConstHelpCreateDistortedModelData |
|
private |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
string IG.Script.LoadableScriptShellNeuralBase.ParallelResultsFilename = "ParallelResults" |
|
protected |
int IG.Script.LoadableScriptShellNeuralBase.ParSimNumRuns = 2 |
Number of runs of simulator in each parallel thread.
int IG.Script.LoadableScriptShellNeuralBase.ParSimNumThreads = 2 |
Number of jobs that can be executed in parallel.
int IG.Script.LoadableScriptShellNeuralBase.ParSimSavingFrequency = 4 |
Specifies how often the results are saved.
|
protected |
string IG.Script.LoadableScriptShellNeuralBase.ParSimResultFilename = "GatheredNeuralTrainingData.json" |
|
protected |
|
protected |
Minimal delay between two successive launches of simulator processes, in milliseconds. This delay is introduced in order to prevent unusual errors that occur when running two simulator processes at approcimately the same time (although they use completely separate data directory structures).
|
private |
|
private |
|
static |
If different than null, this static property provides alternative location of the file which neural network approximator is resd from, in terms of path relative to optimization directory.
|
protected |
|
protected |
|
protected |
|
private |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
private |
|
private |
bool IG.Script.LoadableScriptShellNeuralBase.saveGraphs = false |
|
getprotected set |
Number of optimization parameters.
|
getprotected set |
Number of optimization constraints.
|
get |
Simulation data definition (input and output used by simulator).
|
getprotected set |
Number of simulation input parameters.
|
getprotected set |
Number of simulation output values.
|
getprotected set |
Bounds on simulation input parameters.
|
getprotected set |
|
get |
File manager that provides access to trained neural network and related data.
|
getprotected set |
Trained neural network.
|
getprotected set |
|
getprotected set |
|
getprotected set |
Trained neural network.
|
getprotected set |
Neural data definition.
|
getset |
|
getset |
|
getprotected set |
Number of neural network input parameters.
|
getprotected set |
Number of neural network output values.
|
getprotected set |
Bounds on neural input parameters.
|
get |
Gets the training data.
|
get |
Gets number of all training points, including verification points.
|
get |
Returns some vector of input parameters that is within the range.
This methods just reads and returns the current vector of input parameter from the directory for the first time, and then returns the same vector every time.
|
get |
Vector of input parameters read form the file.