The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



Interface of SDL_Kohonen

const
{$IFDEF PAIDVERS}
  SDLVersionInfo = 'kohonen_r1050_full';
  IsLightEd = false;
{$ELSE}
  SDLVersionInfo = 'kohonen_r1050_lighted';
  IsLightEd = true;
{$ENDIF}
  release = 1050;

type
  TKohonenXMLTag = (xmlSizeX, xmlSizeY, xmlComment, xmlNrInsens, xmlMaxNeighb,
                    xmlMaxSteps, xmlMaxAlpha, xmlCurStep, xmlCyclic, xmlCell,
                    xmlMeanStdDev, xmlEndKohonen, xmlInvalid);
  TKohonen = class (TComponent)
            private
              FMaxNeighb  : integer;       { max. number of neighboring shells }
              FComment    : string;                  { user comment on network }
              FCurNeighb  : integer;      { current neighborhood during train. }
              FMaxSteps   : integer;           { max. number of training steps }
              FCurStep    : integer;            { current time during training }
              FMaxAlpha   : double;            { max. number of training steps }
              FCurAlpha   : double;            { current alpha during training }
              FKohMat     : TMat3D;             { 3 dimensional Kohonen matrix }
              FSizeX      : integer;      { size of Kohonen map in x-direction }
              FSizeY      : integer;      { size of Kohonen map in x-direction }
              FNrInSens   : integer;            { nr. of layers in Kohonen map }
              FNrTrnObj   : integer;                 { nr. of training objects }
              MeanVec     : TVector;       { mean values for standardized data }
              StdDevVec   : TVector;          { std.devs for standardized data }
              FCyclic     : boolean;      { TRUE: cyclic Kohonen map effective }
              FAbort      : boolean;     { flag to abort training via callback }
              FReserved   : boolean;           { reserved for future extension }
              FOnFeedback : TOnPercentDoneEvent;    { feedback during training }
              FDataMat    : TMatrix;                { data matrix for training }
{$IFDEF PAIDVERS}
              FMatsAdj    : boolean; { aux. flag for reading network from file }
              function  ProcessXmlTag (xmlTag: TKohonenXmlTag;
                            attr, cont: string): integer;
{$ENDIF}
              function  GetWeight (ix,iy,wi: integer): double;
              procedure SetNumInsens (nl: integer);
              procedure SetSizeX (x: integer);
              procedure SetSizeY (y: integer);
              procedure SetWeigtsToRandom;
              procedure SetDataMat (x: TMatrix);
            protected
              procedure DoFeedback (PercentDone: integer);
            public
              constructor Create (AOwner: TComponent); override;
              destructor  Destroy; override;
              procedure   ApplyIt (InData: TVector; var BestIx, BestIy: integer;
                             var Distance: double);
              procedure   AbortTraining;
              procedure   ContinueTraining;
              function    LoadFromXMLFile (FName: string; DataID: string): boolean;
              function    ReadFromXMLStream (InStream: TStream;
                             DataID: string): boolean;
              function    ReadFromOpenXMLFile (var InFile: TextFile;
                             DataID: string): boolean;
              procedure   SaveAsXMLFile (FName: string; DataID: string);
              procedure   StandardizeData;
              property    TrainData: TMatrix read FDataMat write SetDataMat;
              procedure   Trainit;
              property    Weights [ix,iy,wi: integer]:double read GetWeight;
              procedure   WriteToXMLStream (OutStream: TStream;
                              CreateHeader: boolean; DataID: string);
              procedure   WriteToOpenXMLFile (var OutFile: TextFile;
                              CreateHeader: boolean; DataID: string);
            published
              property    Comment: string
                              read FComment write FComment;
              property    Cyclic: boolean
                              read FCyclic write FCyclic;
              property    InitialAlpha: double
                              read FMaxAlpha write FMaxAlpha;
              property    InitialNeighbors: integer
                              read FMaxNeighb write FMaxNeighb;
              property    NrOfInSens: integer
                              read FNrInSens write SetNumInsens;
              property    NrOfTrnSteps: integer
                              read FMaxSteps write FMaxSteps;
              property    SizeX: integer
                              read FSizeX write SetSizeX;
              property    SizeY: integer
                              read FSizeY write SetSizeY;
              property    OnFeedback: TOnPercentDoneEvent
                              read FOnFeedBack write FOnFeedback;
            end;







Last Update: 2012-Oct-20