Johannes Lampel - Projects/SOMSim
Just some temp info on the main class ...
class DllExport qSOM2d | ||
---|---|---|
public: | ||
qSOM2d(); | ctor | |
~qSOM2d(); | dtor | |
int SetSize(long,long,long); | set size of map (Dim of Input,x,y) -> x=y isn't too useful | |
int InitWeights(InitType); | ... | |
int SetInput(nVec_var *); | copies input into local class storage | |
nVec_var Categorize(void); | cats input | |
nVec_var Categorize(nVec_var*); | like the two above | |
nVec_var CategorizeFast(void); | cats faster cause it neglects some (!) neurons | |
nVec_var CategorizeFast(nVec_var*); | ... | |
void GetWinner(long &,long &); | finds 'nearest' neuron | |
nVec_var *GetNWeights(long,long); | return the weight matrix of one neuron | |
nVec_var GetDistP(void); | return stiffness param | |
void SetDistP(nVec_var); | ... | |
nVec_var GetLRate(void); | return lRate | |
void SetLRate(nVec_var); | ... | |
void SetNKFunction(nVec_var (*name)(const nVec_var&,const nVec_var&)); | sets the pointer to the NK functions, which is set to fNKgauss1 by default | |
void *GetNKFunction(void); | .. | |
void Save(const char *); | savin' data to file | |
void Load(const char *); | loadin' data from file to mem | |
protected: | ||
long lXSize,lYSize,lNNeurons; | ... | |
long lRow; | lXSize * lNNeurons | |
nVec_var *dp3Weights; | field of weights | |
nVec_var *dp1Input; | input to be categorized or tested | |
nVec_var dLearnrate; | ... | |
nVec_var dDistanceP; | stiffness param | |
char *szVersion; | Just some information about this simulator | |
nVec_var (*fNK)(const nVec_var&,const nVec_var&); | pointer to NK function | |
nVec *pVDiff; | diff (updated by calling cat) between Input and Winner | |
private: |
class DllExport SOMPattern | ||
---|---|---|
public: | ||
SOMPattern(const dim_c); | ctor | |
~SOMPattern(); | dtor | |
int SetMaxPatternNum(const long); | max Number of Pattern - not yet able to copy data from old array to new and no dynamic alloc | |
long AddPattern(const nVec_var *); | ... | |
long AddPattern(const nVec &); | ... (-> calling AddPattern(const nVec_var *) | |
int SetSOM(qSOM2d *); | setting som to be trained | |
int TeachEpoch(const nVec_var&,const nVec_var&); | Teaching a full number of pattern and storing the errors ( return values of qSOM2d :: Categorize ) in a pattern related variable | |
int TeachEpochFast(const nVec_var &,const nVec_var &); | same as above, only using qSOM2d::CategorizeFast | |
protected: | ||
SOMPatternElem *pFPattern; | Field of PatternElem instances with static size | |
long lPDimNum; | Number of dimensions of every Pattern | |
long lPNum; | Number of pattern | |
long lActPPos; | Actual position of last elem ( lActPPos - 1 ) | |
qSOM2d * SActSOM; | som to be trained | |
private: |
class DllExport SOMPattern | ||
---|---|---|
public: | ||
SOMPattern(const dim_c); | ctor | |
~SOMPattern(); | dtor | |
int SetMaxPatternNum(const long); | max Number of Pattern - not yet able to copy data from old array to new and no dynamic alloc | |
long AddPattern(const nVec_var *); | ... | |
long AddPattern(const nVec &); | ... (-> calling AddPattern(const nVec_var *) | |
int SetSOM(qSOM2d *); | setting som to be trained | |
int TeachEpoch(const nVec_var&,const nVec_var&); | Teaching a full number of pattern and storing the errors ( return values of qSOM2d :: Categorize ) in a pattern related variable | |
int TeachEpochFast(const nVec_var &,const nVec_var &); | same as above, only using qSOM2d::CategorizeFast | |
protected: | ||
SOMPatternElem *pFPattern; | Field of PatternElem instances with static size | |
long lPDimNum; | Number of dimensions of every Pattern | |
long lPNum; | Number of pattern | |
long lActPPos; | Actual position of last elem ( lActPPos - 1 ) | |
qSOM2d * SActSOM; | som to be trained | |
private: |
Source :
som.zip