NeurApp 1.1
NeurApp - software for exploring approximation by artificial neural networks on functions of one or two variables.
|
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. | |
virtual string | Test (string[] arguments) |
Runs a custom basic test. In its current variants, it jus prints some data about important directories, etc. | |
virtual string | Custom (string[] arguments) |
Runs a custom test. | |
virtual string | RunParallelSimulations (string[] arguments) |
Runs multiple simulations in parallel threads and saves results in each parallel thread. | |
virtual string | CollectParallelSimulationResults (string[] arguments) |
Collects results of simulations run in parallel threads, joins them into a single object and saves them. | |
override void | Script_AddCommands (ICommandLineApplicationInterpreter interpreter, SortedList< string, string > helpStrings) |
Adds commands to the internal interpreter. | |
virtual IVector | TestApproximation (IVector parameters) |
Performs a test approximation at the specified vector of parameters and outputs and returns results. | |
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. | |
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). Approximations are performed in specified number of equidistant points between the two specified vectors of input parameters. | |
virtual AnalysisResults | TestAnalysis (IVector parameters) |
Performs test analysis at the specified optimization parameters and outputs results. Analysis results are returned, too. | |
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. | |
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. Analyses are performed in specified number of equidistant points between the two specified vectors of parameters. | |
virtual void | OptimizeSimplex () |
virtual void | TransfNeuralToOptimizationParameters (IVector neuralParameters, ref IVector optimizationParameters) |
Maps input parameters for neural network to optimization input parameters. | |
virtual void | TransfOptimizationToNeuralParameters (IVector optimizationParameters, ref IVector neuralParameters) |
Maps optimization input parameters to neural network input parameters. | |
delegate string | ParallelRunDelegate (int threadIndex) |
virtual void | ParSimBegin (int numThreads) |
Launches parallel jobs. | |
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. | |
virtual string | ParSimGetOptimizationDirectoryPath (int threadIndex) |
Returns path to the directory containing optimization data for the specified parallel thread. | |
virtual string | ParSimGetMutexName (int threadIndex) |
Returns name of the mutex for locking data on disk that is used by the specified parallel thread. | |
virtual string | ParSimGetParallelResultsFilePath (int threadIndex) |
Returns path of the file where resuls of calculation in the specified parallel thread are stored. | |
virtual string | GetParallelResultFilePath () |
Returns path of the file where resuls of calculation in the specified parallel thread are stored. | |
virtual void | ParSimPreparelDirectory (int threadIndex) |
Prepares data for running calculations in the parallel thread with the specified index. | |
void | ParSimAddResults (int threadIndex, SampledDataSet results) |
Reads results of the specified thread and adds them to the existing training set. | |
string | ParSimRunJob (int threadIndex) |
Runs the job in the specified parallel thread. | |
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. | |
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. | |
virtual string | ParSimGetSimulationDirectoryPath (int threadIndex) |
Returns the simulation directory for the specified parallel calculation thread. | |
virtual IResponseEvaluatorVectorSimple | ParSimGetSimulator (int threadIndex) |
Creates simulator file manager for the simulator that will the specified parallel task. | |
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. | |
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. | |
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. | |
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. | |
virtual SampledDataElement | GetTrainingElement (int i) |
Gets the training element with the specified index (chosen out of al training points, including verificaion points). | |
virtual bool | IsVerificationPoint (int trainingPointIndex) |
Whether the training point with the specified index is a verification points and has not been used in training. | |
List< SampledDataElement > | GetTrainingElements (bool includeVerificationPoints) |
Returns a list of all neural training elements. The returned list is created anew. | |
List< SampledDataElement > | GetTrainingElements (bool includeVerificationPoints, bool includeNonVerificationPoints) |
Returns a list of all neural training elements. The returned list is created anew. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
virtual int | GetClosestInputIndex (IVector v1, bool includeVerificationPoints) |
Returns index of training element with the shortest distance of its input parameters to the specified vector. | |
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. | |
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. 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). | |
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. 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). | |
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. 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). | |
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. 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). | |
virtual void | NeuralCalculate (params double[] inputParameters) |
Calculates approximation at specified input parameters. | |
virtual void | NeuralCalculate (IVector inputParameters) |
Calculates approximation at specified input parameters. | |
virtual void | NeuralCalculate (IVector inputParameters, ref IVector outputValues) |
Calculates approximation at specified input parameters. | |
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. The global random generator is used to select training elements. | |
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. The global random generator is used to select training elements. | |
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. | |
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. | |
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. Global random generator is used to generate vecor components. | |
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. | |
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. | |
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. | |
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. Global random generator is used to generate vecor components. | |
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. | |
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. | |
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. | |
virtual void | PrepareNeuronsTable (int minNeurons, int maxNeurons, int numNeurons, ref int[] neurpnsTable) |
Prepares table of neurons in geometric sequence. | |
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. | |
virtual string | CreateDistortedModelData (string[] arguments) |
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. | |
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. | |
virtual void | TestNeuralSpeed (int numEvaluations) |
Performs test of speed of calculation of neural network. | |
virtual void | PrintNeuralData () |
This example demonstrates how to extract data necessary for definition of optimization problems. | |
void | SaveSensitivityCSV () |
Saves sensitivity test in csv file. | |
Public Attributes | |
const string | ConstTest = "Test" |
Comamnd name for test. | |
const string | ConstHelpTest = "Test of functionality." |
const string | ConstCustom = "Custom" |
Comamnd name for test. | |
const string | ConstHelpCustom = "Custom command that can be quickly modified as needed, for performing." |
const string | ConstRunParallel = "RunParallel" |
Comamnd name for running parallel simulations. | |
const string | ConstHelpRunParallel = "Runs parallel simulations. Args: numThreads numRunsPerThread" |
const string | ConstCollectParallel = "collectparallel" |
Comamnd name for running parallel simulations. | |
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. | |
const string | ConstHelpCreateDistortedModelData |
string | ParallelResultsFilename = "ParallelResults" |
int | ParSimNumRuns = 2 |
Number of runs of simulator in each parallel thread. | |
int | ParSimNumThreads = 2 |
Number of jobs that can be executed in parallel. | |
int | ParSimSavingFrequency = 4 |
Specifies how often the results are saved. | |
string | ParSimResultFilename = "GatheredNeuralTrainingData.json" |
bool | saveGraphs = false |
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. | |
Protected Member Functions | |
override void | InitializeThis (string[] arguments) |
Inializes the current script object. | |
virtual void | PrintInternalCommandAndArguments (string[] arguments) |
Prints internal command being executed and its actual arguments. | |
virtual void | GetSimulationInputDefault (ref IVector result) |
Gets the vector of default values of simulation parameters and stores it in the specified vector. | |
virtual void | GetSimulationInputMin (ref IVector result) |
Gets the vector of lower bounds on simulation parameters and stores it in the specified vector. | |
virtual void | GetSimulationInputMax (ref IVector result) |
Gets the vector of upper bounds on simulation parameters and stores it in the specified vector. | |
virtual void | ParSimPrepareDirectories (int numThreads) |
Prepares data for the specified number of parallel execution threads. | |
virtual void | ParSimWaitAllCompletion () |
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). | |
virtual void | ParSimAsyncCallback (IAsyncResult ar) |
Callback method for asynchronous runs. | |
virtual string | ParSimGetDirectoryExtension (int threadIndex) |
Returns directory extension for data directory used in the specified parallel calculation thread. | |
virtual void | GetNeuralInputDefault (ref IVector result) |
Gets the vector of default values of neural parameters and stores it in the specified vector. | |
virtual void | GetNeuralInputMin (ref IVector result) |
Gets the vector of lower bounds on neural parameters and stores it in the specified vector. | |
virtual void | GetNeuralInputMax (ref IVector result) |
Gets the vector of upper bounds on neural parameters and stores it in the specified vector. | |
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. | |
Protected Attributes | |
IVector | _simulationInputDefault |
IVector | _simulationInputMin |
IVector | _simulationInputMax |
IBoundingBox | _simulationInputBounds |
string | _parallelResultsFilename = "ParallelResults" |
string | _parallelResultsFileExtension = ".json" |
List< IAsyncResult > | ParallelResults |
object | ParSimProcessDelayLock = new object() |
int | ParSimProcessDelayMilliseconds = 500 |
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). | |
List< IVector > | _sensitivityResultsVerification |
List< IVector > | _sensitivityResultsTraining |
INeuralApproximator | _trainedNetwork |
SampledDataSet | _trainingData |
SampledDataSet | _verificationData |
IVector | _neuralInputDefault |
IVector | _neuralInputMin |
IVector | _neuralInputMax |
IBoundingBox | _neuralInputBounds |
Properties | |
abstract int | NumOptimizationParameters [get, set] |
Number of optimization parameters. | |
abstract int | NumOptimizationConstraints [get, set] |
Number of optimization constraints. | |
virtual InputOutputDataDefiniton | SimulationDataDefinition [get] |
Simulation data definition (input and output used by simulator). | |
virtual int | NumSimulationParameters [get, set] |
Number of simulation input parameters. | |
virtual int | NumSimulationOutputs [get, set] |
Number of simulation output values. | |
virtual IBoundingBox | SimulationInputBounds [get, set] |
Bounds on simulation input parameters. | |
string | ParallelResultsFileExtension [get, set] |
virtual NeuraApproximationFileManager | NeuralFM [get] |
File manager that provides access to trained neural network and related data. | |
virtual INeuralApproximator | TrainedNetwork [get, set] |
Trained neural network. | |
virtual List< IVector > | SensitivityVerificationResults [get, set] |
virtual List< IVector > | SensitivityTrainingResults [get, set] |
virtual INeuralApproximator | XXX_TrainedNetwork [get, set] |
Trained neural network. | |
virtual InputOutputDataDefiniton | NeuralDataDefinition [get, set] |
Neural data definition. | |
virtual SampledDataSet | TrainingData [get, set] |
virtual SampledDataSet | VerificationData [get, set] |
virtual int | NumNeuralParameters [get, set] |
Number of neural network input parameters. | |
virtual int | NumNeuralOutputs [get, set] |
Number of neural network output values. | |
virtual IBoundingBox | NeuralInputBounds [get, set] |
Bounds on neural input parameters. | |
virtual SampledDataSet | NeuralTrainingData [get] |
Gets the training data. | |
virtual int | NumAllTrainingPoints [get] |
Gets number of all training points, including verification points. | |
virtual IVector | SomeNeuralInput [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. | |
virtual IVector | NeuralInputFromFile [get] |
Vector of input parameters read form the file. | |
Private Attributes | |
InputOutputDataDefiniton | _simulationDataDefinition |
IVector | _neuralInput |
NeuraApproximationFileManager | _neuralFileManager |
InputOutputDataDefiniton | _neuralDataDefinition |
SampledDataSet | _neuralTrainingData |
IVector | _someInput |
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;
IG::Script::LoadableScriptShellNeuralBase::LoadableScriptShellNeuralBase | ( | ) | [inline] |
override void IG::Script::LoadableScriptShellNeuralBase::InitializeThis | ( | string[] | arguments | ) | [inline, protected] |
Inializes the current script object.
arguments | Initialization arguments. The first argument must be the working directory path. |
Reimplemented from IG::Lib::LoadableScriptShellBase.
Reimplemented in IG::Script::LoadableScriptShellNeural.
override void IG::Script::LoadableScriptShellNeuralBase::Analyse | ( | Num.IAnalysisResults | anRes | ) | [inline] |
Dummy analysis, jsut throws the exception.
anRes |
NotImplementedException
Reimplemented in IG::Script::LoadableScriptShellNeural.
virtual void IG::Script::LoadableScriptShellNeuralBase::PrintInternalCommandAndArguments | ( | string[] | arguments | ) | [inline, protected, virtual] |
Prints internal command being executed and its actual arguments.
arguments | Script run arguments, the first one is command name. |
virtual string IG::Script::LoadableScriptShellNeuralBase::Test | ( | string[] | arguments | ) | [inline, virtual] |
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. |
virtual string IG::Script::LoadableScriptShellNeuralBase::Custom | ( | string[] | arguments | ) | [inline, virtual] |
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.
virtual string IG::Script::LoadableScriptShellNeuralBase::RunParallelSimulations | ( | string[] | arguments | ) | [inline, virtual] |
Runs multiple simulations in parallel threads and saves results in each parallel thread.
arguments | Command arguments, first one (index 0) is always command name. |
virtual string IG::Script::LoadableScriptShellNeuralBase::CollectParallelSimulationResults | ( | string[] | arguments | ) | [inline, virtual] |
Collects results of simulations run in parallel threads, joins them into a single object and saves them.
arguments | Command arguments. |
override void IG::Script::LoadableScriptShellNeuralBase::Script_AddCommands | ( | ICommandLineApplicationInterpreter | interpreter, |
SortedList< string, string > | helpStrings | ||
) | [inline] |
Adds commands to the internal interpreter.
interpreter | Interpreter where commands are executed. |
helpStrings | List containg help strings. |
virtual IVector IG::Script::LoadableScriptShellNeuralBase::TestApproximation | ( | IVector | parameters | ) | [inline, virtual] |
Performs a test approximation at the specified vector of parameters and outputs and returns results.
parameters | Parameters at which approximation output vector is calculated. |
virtual IVector [][] IG::Script::LoadableScriptShellNeuralBase::TestApproximationTable | ( | int | numPoints | ) | [inline, virtual] |
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. |
virtual IVector [][] IG::Script::LoadableScriptShellNeuralBase::TestApproximationTable | ( | IVector | param1, |
IVector | param2, | ||
int | numPoints | ||
) | [inline, virtual] |
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. |
virtual AnalysisResults IG::Script::LoadableScriptShellNeuralBase::TestAnalysis | ( | IVector | parameters | ) | [inline, virtual] |
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. |
virtual AnalysisResults [] IG::Script::LoadableScriptShellNeuralBase::TestAnalysisTable | ( | int | numPoints | ) | [inline, virtual] |
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. |
virtual AnalysisResults [] IG::Script::LoadableScriptShellNeuralBase::TestAnalysisTable | ( | IVector | param1, |
IVector | param2, | ||
int | numPoints | ||
) | [inline, virtual] |
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. |
virtual void IG::Script::LoadableScriptShellNeuralBase::OptimizeSimplex | ( | ) | [inline, virtual] |
virtual void IG::Script::LoadableScriptShellNeuralBase::TransfNeuralToOptimizationParameters | ( | IVector | neuralParameters, |
ref IVector | optimizationParameters | ||
) | [inline, virtual] |
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. |
virtual void IG::Script::LoadableScriptShellNeuralBase::TransfOptimizationToNeuralParameters | ( | IVector | optimizationParameters, |
ref IVector | neuralParameters | ||
) | [inline, virtual] |
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. |
virtual void IG::Script::LoadableScriptShellNeuralBase::GetSimulationInputDefault | ( | ref IVector | result | ) | [inline, protected, virtual] |
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.
virtual void IG::Script::LoadableScriptShellNeuralBase::GetSimulationInputMin | ( | ref IVector | result | ) | [inline, protected, virtual] |
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
virtual void IG::Script::LoadableScriptShellNeuralBase::GetSimulationInputMax | ( | ref IVector | result | ) | [inline, protected, virtual] |
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
delegate string IG::Script::LoadableScriptShellNeuralBase::ParallelRunDelegate | ( | int | threadIndex | ) |
virtual void IG::Script::LoadableScriptShellNeuralBase::ParSimPrepareDirectories | ( | int | numThreads | ) | [inline, protected, virtual] |
Prepares data for the specified number of parallel execution threads.
numThreads | Number of parallel threads for which data is prepared. |
virtual void IG::Script::LoadableScriptShellNeuralBase::ParSimWaitAllCompletion | ( | ) | [inline, protected, virtual] |
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).
virtual void IG::Script::LoadableScriptShellNeuralBase::ParSimBegin | ( | int | numThreads | ) | [inline, virtual] |
Launches parallel jobs.
numThreads | Number of parallel threads for which data is prepared. |
virtual void IG::Script::LoadableScriptShellNeuralBase::GatherParallelResults | ( | int | numThreads | ) | [inline, virtual] |
Reads results form all parallel threads, gathers them in a single training set, and saves them in the template optimiation directory.
virtual void IG::Script::LoadableScriptShellNeuralBase::ParSimAsyncCallback | ( | IAsyncResult | ar | ) | [inline, protected, virtual] |
Callback method for asynchronous runs.
ar | Asynchronous results that are passed to the method. |
virtual string IG::Script::LoadableScriptShellNeuralBase::ParSimGetDirectoryExtension | ( | int | threadIndex | ) | [inline, protected, virtual] |
Returns directory extension for data directory used in the specified parallel calculation thread.
threadIndex | Index of the parllel calculation thread and corresponding data directory. |
virtual string IG::Script::LoadableScriptShellNeuralBase::ParSimGetOptimizationDirectoryPath | ( | int | threadIndex | ) | [inline, virtual] |
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. |
virtual string IG::Script::LoadableScriptShellNeuralBase::ParSimGetMutexName | ( | int | threadIndex | ) | [inline, virtual] |
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. |
virtual string IG::Script::LoadableScriptShellNeuralBase::ParSimGetParallelResultsFilePath | ( | int | threadIndex | ) | [inline, virtual] |
Returns path of the file where resuls of calculation in the specified parallel thread are stored.
threadIndex | Index of the parallel thread. |
virtual string IG::Script::LoadableScriptShellNeuralBase::GetParallelResultFilePath | ( | ) | [inline, virtual] |
Returns path of the file where resuls of calculation in the specified parallel thread are stored.
threadIndex | Index of the parallel thread. |
virtual void IG::Script::LoadableScriptShellNeuralBase::ParSimPreparelDirectory | ( | int | threadIndex | ) | [inline, virtual] |
Prepares data for running calculations in the parallel thread with the specified index.
threadIndex |
void IG::Script::LoadableScriptShellNeuralBase::ParSimAddResults | ( | int | threadIndex, |
SampledDataSet | results | ||
) | [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. |
string IG::Script::LoadableScriptShellNeuralBase::ParSimRunJob | ( | int | threadIndex | ) | [inline] |
Runs the job in the specified parallel thread.
threadIndex | Index of the parallel thread. |
virtual void IG::Script::LoadableScriptShellNeuralBase::ParSimGetNextInput | ( | ref IVector | simInput | ) | [inline, virtual] |
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.
virtual void IG::Script::LoadableScriptShellNeuralBase::ParSimGetNextNeuralInput | ( | ref IVector | simInput | ) | [inline, virtual] |
Generates the next vector of neural input parameters that will be used for calculation of a new training element.
virtual string IG::Script::LoadableScriptShellNeuralBase::ParSimGetSimulationDirectoryPath | ( | int | threadIndex | ) | [inline, virtual] |
Returns the simulation directory for the specified parallel calculation thread.
threadIndex | Index of parallel calculation thread for which the directory is returned. |
virtual IResponseEvaluatorVectorSimple IG::Script::LoadableScriptShellNeuralBase::ParSimGetSimulator | ( | int | threadIndex | ) | [inline, virtual] |
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>
abstract void IG::Script::LoadableScriptShellNeuralBase::TransfSimulationToNeuralInput | ( | IVector | original, |
ref IVector | result | ||
) | [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.
virtual void IG::Script::LoadableScriptShellNeuralBase::TransfNeuralToSimulationInput | ( | IVector | original, |
ref IVector | result | ||
) | [inline, virtual] |
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.
virtual void IG::Script::LoadableScriptShellNeuralBase::TransfSimulationToNeuralOutput | ( | IVector | original, |
ref IVector | result | ||
) | [inline, virtual] |
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.
virtual void IG::Script::LoadableScriptShellNeuralBase::TransfNeuralToSimulationOutput | ( | IVector | original, |
ref IVector | result | ||
) | [inline, virtual] |
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.
virtual void IG::Script::LoadableScriptShellNeuralBase::GetNeuralInputDefault | ( | ref IVector | result | ) | [inline, protected, virtual] |
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.
virtual void IG::Script::LoadableScriptShellNeuralBase::GetNeuralInputMin | ( | ref IVector | result | ) | [inline, protected, virtual] |
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
virtual void IG::Script::LoadableScriptShellNeuralBase::GetNeuralInputMax | ( | ref IVector | result | ) | [inline, protected, virtual] |
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
virtual SampledDataElement IG::Script::LoadableScriptShellNeuralBase::GetTrainingElement | ( | int | i | ) | [inline, virtual] |
Gets the training element with the specified index (chosen out of al training points, including verificaion points).
virtual bool IG::Script::LoadableScriptShellNeuralBase::IsVerificationPoint | ( | int | trainingPointIndex | ) | [inline, virtual] |
Whether the training point with the specified index is a verification points and has not been used in training.
List<SampledDataElement> IG::Script::LoadableScriptShellNeuralBase::GetTrainingElements | ( | bool | includeVerificationPoints | ) | [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. |
List<SampledDataElement> IG::Script::LoadableScriptShellNeuralBase::GetTrainingElements | ( | bool | includeVerificationPoints, |
bool | includeNonVerificationPoints | ||
) | [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. |
virtual void IG::Script::LoadableScriptShellNeuralBase::GetNeuralInputPerturbance | ( | double | ratio, |
ref IVector | perturbance | ||
) | [inline, virtual] |
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. |
virtual void IG::Script::LoadableScriptShellNeuralBase::GetNeuralOutputPerturbance | ( | double | ratio, |
ref IVector | perturbance | ||
) | [inline, virtual] |
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. |
virtual void IG::Script::LoadableScriptShellNeuralBase::GetNeuralInputVector | ( | double | relativeComponents, |
ref IVector | inputVector | ||
) | [inline, virtual] |
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. |
virtual void IG::Script::LoadableScriptShellNeuralBase::GetNeuralOutputVector | ( | double | relativeComponents, |
ref IVector | outputVector | ||
) | [inline, virtual] |
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. |
virtual void IG::Script::LoadableScriptShellNeuralBase::GetNeuralInputVector | ( | IVector | relativeComponents, |
ref IVector | inputVector | ||
) | [inline, virtual] |
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. |
virtual void IG::Script::LoadableScriptShellNeuralBase::GetNeuralOutputVector | ( | IVector | relativeComponents, |
ref IVector | outputVector | ||
) | [inline, virtual] |
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. |
virtual void IG::Script::LoadableScriptShellNeuralBase::GetNeuralInputRelative | ( | IVector | inputVector, |
ref IVector | relativeComponents | ||
) | [inline, virtual] |
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. |
virtual void IG::Script::LoadableScriptShellNeuralBase::GetNeuralOutputRelative | ( | IVector | outputVector, |
ref IVector | relativeComponents | ||
) | [inline, virtual] |
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. |
virtual double IG::Script::LoadableScriptShellNeuralBase::InputDistance | ( | IVector | v1, |
IVector | v2 | ||
) | [inline, virtual] |
Returns measure of distance between two vectors in the space of input parameters. Euclidean norm scaled accorging to individual parameter ranges is returned.
virtual double IG::Script::LoadableScriptShellNeuralBase::OutputDistance | ( | IVector | v1, |
IVector | v2 | ||
) | [inline, virtual] |
Returns measure of distance between two vectors in the space of output parameters. Euclidean norm scaled accorging to individual parameter ranges is returned.
virtual double IG::Script::LoadableScriptShellNeuralBase::InputDistance | ( | IVector | v1, |
int | trainingPointIndex | ||
) | [inline, virtual] |
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. |
virtual double IG::Script::LoadableScriptShellNeuralBase::OutputDistance | ( | IVector | v1, |
int | trainingPointIndex | ||
) | [inline, virtual] |
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. |
virtual int IG::Script::LoadableScriptShellNeuralBase::GetClosestInputIndex | ( | IVector | v1, |
bool | includeVerificationPoints | ||
) | [inline, virtual] |
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. |
virtual int IG::Script::LoadableScriptShellNeuralBase::GetClosestOutputIndex | ( | IVector | v1, |
bool | includeVerificationPoints | ||
) | [inline, virtual] |
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. |
void IG::Script::LoadableScriptShellNeuralBase::TestClosestPoints | ( | int | numClosestPoints, |
bool | includeVerificationPoints, | ||
bool | printByComponents, | ||
params IVector[] | 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. 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. |
void IG::Script::LoadableScriptShellNeuralBase::TestClosestPoints | ( | int | numClosestPoints, |
bool | includeVerificationPoints, | ||
bool | printByComponents, | ||
bool | printIndividualPointsComp, | ||
params IVector[] | 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. |
void IG::Script::LoadableScriptShellNeuralBase::TestClosestPoints | ( | int | numClosestPoints, |
bool | includeVerificationPoints, | ||
bool | printByComponents, | ||
params SampledDataElement[] | 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. 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. |
void IG::Script::LoadableScriptShellNeuralBase::TestClosestPoints | ( | int | numClosestPoints, |
bool | includeVerificationPoints, | ||
bool | printByComponents, | ||
bool | printIndividualPointsComp, | ||
params SampledDataElement[] | 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
|
virtual void IG::Script::LoadableScriptShellNeuralBase::NeuralCalculate | ( | params double[] | inputParameters | ) | [inline, virtual] |
Calculates approximation at specified input parameters.
inputParameters | Input parameters. |
virtual void IG::Script::LoadableScriptShellNeuralBase::NeuralCalculate | ( | IVector | inputParameters | ) | [inline, virtual] |
Calculates approximation at specified input parameters.
inputParameters | Input parameters. |
virtual void IG::Script::LoadableScriptShellNeuralBase::NeuralCalculate | ( | IVector | inputParameters, |
ref IVector | outputValues | ||
) | [inline, virtual] |
Calculates approximation at specified input parameters.
inputParameters | Input parameters. |
virtual List<SampledDataElement> IG::Script::LoadableScriptShellNeuralBase::GetRandomTrainingElements | ( | int | numElements, |
bool | includeVerificationPoints | ||
) | [inline, virtual] |
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. |
virtual List<SampledDataElement> IG::Script::LoadableScriptShellNeuralBase::GetRandomTrainingElements | ( | int | numElements, |
bool | includeVerificationPoints, | ||
bool | includeNonVerificationPoints | ||
) | [inline, virtual] |
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. |
virtual List<SampledDataElement> IG::Script::LoadableScriptShellNeuralBase::GetRandomTrainingElements | ( | IRandomGenerator | rand, |
int | numElements, | ||
bool | includeVerificationPoints | ||
) | [inline, virtual] |
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. |
virtual List<SampledDataElement> IG::Script::LoadableScriptShellNeuralBase::GetRandomTrainingElements | ( | IRandomGenerator | rand, |
int | numElements, | ||
bool | includeVerificationPoints, | ||
bool | includeNonVerificationPoints | ||
) | [inline, virtual] |
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. |
virtual IVector IG::Script::LoadableScriptShellNeuralBase::GetRandomNeuralInput | ( | ) | [inline, virtual] |
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.
virtual void IG::Script::LoadableScriptShellNeuralBase::GetRandomNeuralInput | ( | IRandomGenerator | rand, |
ref IVector | result | ||
) | [inline, virtual] |
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. |
virtual IVector IG::Script::LoadableScriptShellNeuralBase::GetRandomNeuralInput | ( | IRandomGenerator | rand | ) | [inline, virtual] |
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. |
virtual void IG::Script::LoadableScriptShellNeuralBase::GetRandomNeuralInput | ( | ref IVector | result | ) | [inline, virtual] |
Generates a random vector of neural input parameters whose elements (components) lie within the lower and upper bounds on parameters.
virtual void IG::Script::LoadableScriptShellNeuralBase::GetRandomNeuralInputFromDataDefinition | ( | IRandomGenerator | rand, |
ref IVector | result | ||
) | [inline, protected, virtual] |
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. |
virtual IVector IG::Script::LoadableScriptShellNeuralBase::GetRandomNeuralOutput | ( | ) | [inline, virtual] |
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.
virtual IVector IG::Script::LoadableScriptShellNeuralBase::GetRandomNeuralOutput | ( | IRandomGenerator | rand | ) | [inline, virtual] |
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. |
virtual void IG::Script::LoadableScriptShellNeuralBase::GetRandomNeuralOutput | ( | ref IVector | result | ) | [inline, virtual] |
Generates a random vector of neural output values whose elements (components) lie within the lower and upper bounds on values.
virtual void IG::Script::LoadableScriptShellNeuralBase::GetRandomNeuralOutput | ( | IRandomGenerator | rand, |
ref IVector | result | ||
) | [inline, virtual] |
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. |
virtual void IG::Script::LoadableScriptShellNeuralBase::PrepareNeuronsTable | ( | int | minNeurons, |
int | maxNeurons, | ||
int | numNeurons, | ||
ref int[] | neurpnsTable | ||
) | [inline, virtual] |
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;
void IG::Script::LoadableScriptShellNeuralBase::TrainANN | ( | int | annType, |
int | NumNeurons, | ||
int | MaxEpochs, | ||
int | EpochsInBundle, | ||
double | LearnignRate, | ||
double | Momentum, | ||
double | InputSafetyFactor, | ||
double | OutputSafetyFactor, | ||
double | PercentVerificationPoints | ||
) | [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. |
virtual string IG::Script::LoadableScriptShellNeuralBase::CreateDistortedModelData | ( | string[] | arguments | ) | [inline, virtual] |
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).
virtual void IG::Script::LoadableScriptShellNeuralBase::TestDistances | ( | int | referencePointIndex, |
int | maxNumPoints | ||
) | [inline, virtual] |
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. |
virtual void IG::Script::LoadableScriptShellNeuralBase::TestNeuralSpeed | ( | int | numEvaluations | ) | [inline, virtual] |
Performs test of speed of calculation of neural network.
numEvaluations | Number of times the approximation is calculated. |
virtual void IG::Script::LoadableScriptShellNeuralBase::PrintNeuralData | ( | ) | [inline, virtual] |
This example demonstrates how to extract data necessary for definition of optimization problems.
void IG::Script::LoadableScriptShellNeuralBase::SaveSensitivityCSV | ( | ) | [inline] |
Saves sensitivity test in csv file.
$A Tako78 Jul13;
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.
ConstCreateDistortedModelData + @" WorkingDirectory DistortedModelDirectory ChangeElementNames ChangeTitlesAndDescriptions DataDefinitionFile - creates data definition and data files for a model that is obtained by distortion of the specified original model.Parameters: WorkingDirectory - working directory where the original model is found. DistortedModelDirectory - directory where distorted model is stored. NumDataPoints - number of data points in the sampled data generated by the original model. ChangeElementNames - optional; whether data element names are changed. ChangeTitlesAndDescriptions - optional; whether element titles and descriptions are changed. DataDefinitionFile - optinal; data definition file for distorted model. If specified then new parameter bounds and other data (names, titles, descriptions, etc.) are taken from here. 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). "
InputOutputDataDefiniton IG::Script::LoadableScriptShellNeuralBase::_simulationDataDefinition [private] |
IVector IG::Script::LoadableScriptShellNeuralBase::_simulationInputDefault [protected] |
IVector IG::Script::LoadableScriptShellNeuralBase::_simulationInputMin [protected] |
IVector IG::Script::LoadableScriptShellNeuralBase::_simulationInputMax [protected] |
IBoundingBox IG::Script::LoadableScriptShellNeuralBase::_simulationInputBounds [protected] |
string IG::Script::LoadableScriptShellNeuralBase::_parallelResultsFilename = "ParallelResults" [protected] |
string IG::Script::LoadableScriptShellNeuralBase::ParallelResultsFilename = "ParallelResults" |
string IG::Script::LoadableScriptShellNeuralBase::_parallelResultsFileExtension = ".json" [protected] |
Number of runs of simulator in each parallel thread.
Number of jobs that can be executed in parallel.
Specifies how often the results are saved.
List<IAsyncResult> IG::Script::LoadableScriptShellNeuralBase::ParallelResults [protected] |
string IG::Script::LoadableScriptShellNeuralBase::ParSimResultFilename = "GatheredNeuralTrainingData.json" |
object IG::Script::LoadableScriptShellNeuralBase::ParSimProcessDelayLock = new object() [protected] |
int IG::Script::LoadableScriptShellNeuralBase::ParSimProcessDelayMilliseconds = 500 [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).
IVector IG::Script::LoadableScriptShellNeuralBase::_neuralInput [private] |
NeuraApproximationFileManager IG::Script::LoadableScriptShellNeuralBase::_neuralFileManager [private] |
string IG::Script::LoadableScriptShellNeuralBase::TrainedNetworkAlternativeLovation = null [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.
List<IVector> IG::Script::LoadableScriptShellNeuralBase::_sensitivityResultsVerification [protected] |
List<IVector> IG::Script::LoadableScriptShellNeuralBase::_sensitivityResultsTraining [protected] |
InputOutputDataDefiniton IG::Script::LoadableScriptShellNeuralBase::_neuralDataDefinition [private] |
SampledDataSet IG::Script::LoadableScriptShellNeuralBase::_trainingData [protected] |
SampledDataSet IG::Script::LoadableScriptShellNeuralBase::_verificationData [protected] |
IVector IG::Script::LoadableScriptShellNeuralBase::_neuralInputDefault [protected] |
IVector IG::Script::LoadableScriptShellNeuralBase::_neuralInputMin [protected] |
IVector IG::Script::LoadableScriptShellNeuralBase::_neuralInputMax [protected] |
IBoundingBox IG::Script::LoadableScriptShellNeuralBase::_neuralInputBounds [protected] |
SampledDataSet IG::Script::LoadableScriptShellNeuralBase::_neuralTrainingData [private] |
IVector IG::Script::LoadableScriptShellNeuralBase::_someInput [private] |
abstract int IG::Script::LoadableScriptShellNeuralBase::NumOptimizationParameters [get, set] |
Number of optimization parameters.
Reimplemented in IG::Script::LoadableScriptShellNeural.
abstract int IG::Script::LoadableScriptShellNeuralBase::NumOptimizationConstraints [get, set] |
Number of optimization constraints.
Reimplemented in IG::Script::LoadableScriptShellNeural.
virtual InputOutputDataDefiniton IG::Script::LoadableScriptShellNeuralBase::SimulationDataDefinition [get] |
Simulation data definition (input and output used by simulator).
virtual int IG::Script::LoadableScriptShellNeuralBase::NumSimulationParameters [get, set] |
Number of simulation input parameters.
virtual int IG::Script::LoadableScriptShellNeuralBase::NumSimulationOutputs [get, set] |
Number of simulation output values.
virtual IBoundingBox IG::Script::LoadableScriptShellNeuralBase::SimulationInputBounds [get, set] |
Bounds on simulation input parameters.
string IG::Script::LoadableScriptShellNeuralBase::ParallelResultsFileExtension [get, set] |
virtual NeuraApproximationFileManager IG::Script::LoadableScriptShellNeuralBase::NeuralFM [get] |
File manager that provides access to trained neural network and related data.
virtual INeuralApproximator IG::Script::LoadableScriptShellNeuralBase::TrainedNetwork [get, set] |
Trained neural network.
Implements IG::Neural::INeuralModel.
virtual List<IVector> IG::Script::LoadableScriptShellNeuralBase::SensitivityVerificationResults [get, set] |
virtual List<IVector> IG::Script::LoadableScriptShellNeuralBase::SensitivityTrainingResults [get, set] |
virtual INeuralApproximator IG::Script::LoadableScriptShellNeuralBase::XXX_TrainedNetwork [get, set] |
Trained neural network.
virtual InputOutputDataDefiniton IG::Script::LoadableScriptShellNeuralBase::NeuralDataDefinition [get, set] |
Neural data definition.
Implements IG::Neural::INeuralModel.
virtual SampledDataSet IG::Script::LoadableScriptShellNeuralBase::TrainingData [get, set] |
virtual SampledDataSet IG::Script::LoadableScriptShellNeuralBase::VerificationData [get, set] |
virtual int IG::Script::LoadableScriptShellNeuralBase::NumNeuralParameters [get, set] |
Number of neural network input parameters.
virtual int IG::Script::LoadableScriptShellNeuralBase::NumNeuralOutputs [get, set] |
Number of neural network output values.
virtual IBoundingBox IG::Script::LoadableScriptShellNeuralBase::NeuralInputBounds [get, set] |
Bounds on neural input parameters.
virtual SampledDataSet IG::Script::LoadableScriptShellNeuralBase::NeuralTrainingData [get] |
Gets the training data.
virtual int IG::Script::LoadableScriptShellNeuralBase::NumAllTrainingPoints [get] |
Gets number of all training points, including verification points.
virtual IVector IG::Script::LoadableScriptShellNeuralBase::SomeNeuralInput [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.
virtual IVector IG::Script::LoadableScriptShellNeuralBase::NeuralInputFromFile [get] |
Vector of input parameters read form the file.