00001 #ifndef __private_mlp_gen_h
00002 #define __private_mlp_gen_h
00003
00004 #if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ >= 4)
00005 # define MLP_HIDDEN __attribute__((visibility("hidden")))
00006 #endif
00007
00008 #ifdef __cplusplus
00009 extern "C" {
00010 #endif
00011
00012 typedef double dbl;
00013 typedef double type_pat;
00014
00015
00016 extern struct net_
00017 {
00018 int Nlayer, *Nneur, Nweights;
00019 dbl ***Weights;
00020 dbl **vWeights;
00021 dbl **Deriv1, **Inn, **Outn, **Delta;
00022 int **T_func;
00023 int Rdwt, Debug;
00024 } net_ MLP_HIDDEN;
00025 #define NET net_
00026
00027
00028 extern struct learn_
00029 {
00030 int Nepoch, Meth, Nreset;
00031 dbl Tau,Norm,Decay,Lambda,Alambda;
00032 dbl eta, epsilon, delta;
00033 dbl ***Odw;
00034 dbl ***DeDw, ***ODeDw;
00035 } learn_ MLP_HIDDEN;
00036 #define LEARN learn_
00037
00038 extern struct pat_
00039 {
00040 int Npat[2], Iponde, Nin, Nout;
00041 type_pat ***Rin, ***Rans, **Pond;
00042 type_pat **vRin;
00043 dbl Ponds[10];
00044 } pat_ MLP_HIDDEN;
00045 #define PAT pat_
00046
00047 extern struct divers_
00048 {
00049 int Dbin;
00050 int Ihess;
00051 int Norm, Stat;
00052 char Outf;
00053 } divers_ MLP_HIDDEN;
00054 #define DIVERS divers_
00055
00056 extern struct stat_
00057 {
00058 dbl *mean,*sigma;
00059 } stat_ MLP_HIDDEN;
00060 #define STAT stat_
00061
00062 extern int MessLang MLP_HIDDEN;
00063 extern int OutputWeights MLP_HIDDEN;
00064 extern int ExamplesMemory MLP_HIDDEN;
00065 extern int WeightsMemory MLP_HIDDEN;
00066 extern int PatMemory[2] MLP_HIDDEN;
00067 extern int BFGSMemory MLP_HIDDEN;
00068 extern int JacobianMemory MLP_HIDDEN;
00069 extern int LearnMemory MLP_HIDDEN;
00070 extern int NetMemory MLP_HIDDEN;
00071 extern float MLPfitVersion MLP_HIDDEN;
00072 extern dbl LastAlpha MLP_HIDDEN;
00073 extern int NLineSearchFail MLP_HIDDEN;
00074
00075 extern dbl ***dir MLP_HIDDEN;
00076 extern dbl *delta MLP_HIDDEN;
00077 extern dbl **BFGSH MLP_HIDDEN;
00078 extern dbl *Gamma MLP_HIDDEN;
00079 extern dbl **JacobianMatrix MLP_HIDDEN;
00080 extern int *ExamplesIndex MLP_HIDDEN;
00081 extern dbl **Hessian MLP_HIDDEN;
00082
00083 extern void MLP_Out(type_pat *rrin, dbl *rrout) MLP_HIDDEN;
00084 extern void MLP_Out2(type_pat *rrin) MLP_HIDDEN;
00085 extern void MLP_Out_T(type_pat *rrin) MLP_HIDDEN;
00086 extern dbl MLP_Test(int ifile, int regul) MLP_HIDDEN;
00087 extern dbl MLP_Epoch(int iepoch, dbl *alpmin, int *ntest) MLP_HIDDEN;
00088 extern int MLP_Train(int *ipat,dbl *err) MLP_HIDDEN;
00089 extern dbl MLP_Stochastic() MLP_HIDDEN;
00090
00091 extern int StochStep() MLP_HIDDEN;
00092
00093 extern dbl DeDwNorm() MLP_HIDDEN;
00094 extern dbl DeDwProd() MLP_HIDDEN;
00095 extern void DeDwZero() MLP_HIDDEN;
00096 extern void DeDwSaveZero() MLP_HIDDEN;
00097 extern void DeDwScale(int Nexamples) MLP_HIDDEN;
00098 extern void DeDwSave() MLP_HIDDEN;
00099 extern int DeDwSum(type_pat *ans, dbl *out, int ipat) MLP_HIDDEN;
00100
00101 extern int SetTransFunc(int layer, int neuron, int func) MLP_HIDDEN;
00102 extern void SetDefaultFuncs() MLP_HIDDEN;
00103
00104 extern void SteepestDir() MLP_HIDDEN;
00105 extern void CGDir(dbl beta) MLP_HIDDEN;
00106 extern dbl DerivDir() MLP_HIDDEN;
00107 extern void GetGammaDelta() MLP_HIDDEN;
00108 extern void BFGSdir(int Nweights) MLP_HIDDEN;
00109 extern void InitBFGSH(int Nweights) MLP_HIDDEN;
00110 extern int GetBFGSH(int Nweights) MLP_HIDDEN;
00111
00112 extern int LineSearch(dbl *alpmin, int *Ntest, dbl Err0) MLP_HIDDEN;
00113 extern int DecreaseSearch(dbl *alpmin, int *Ntest, dbl Err0) MLP_HIDDEN;
00114 extern void MLP_ResLin() MLP_HIDDEN;
00115 extern void MLP_Line(dbl ***w0, dbl alpha) MLP_HIDDEN;
00116 extern int LineSearchHyb(dbl *alpmin, int *Ntest) MLP_HIDDEN;
00117 extern void MLP_LineHyb(dbl ***w0, dbl alpha) MLP_HIDDEN;
00118 extern int StochStepHyb() MLP_HIDDEN;
00119 extern int FixedStep(dbl alpha) MLP_HIDDEN;
00120
00121 extern void EtaDecay() MLP_HIDDEN;
00122 extern int ShuffleExamples(int n, int *index) MLP_HIDDEN;
00123 extern double MLP_Rand(dbl min, dbl max) MLP_HIDDEN;
00124 extern void InitWeights() MLP_HIDDEN;
00125 extern int NormalizeInputs() MLP_HIDDEN;
00126 extern int MLP_StatInputs(int Nexamples, int Ninputs, type_pat **inputs,
00127 dbl *mean, dbl *sigma, dbl *minimum, dbl *maximum) MLP_HIDDEN;
00128 extern int MLP_PrintInputStat() MLP_HIDDEN;
00129
00130 extern int LoadWeights(char *filename, int *iepoch) MLP_HIDDEN;
00131 extern int SaveWeights(char *filename, int iepoch) MLP_HIDDEN;
00132
00133 extern void SetLambda(double Wmax) MLP_HIDDEN;
00134 extern void PrintWeights() MLP_HIDDEN;
00135 extern int ReadPatterns(char *filename, int ifile,
00136 int *inet, int *ilearn, int *iexamples) MLP_HIDDEN;
00137 extern int CountLexemes(char *string) MLP_HIDDEN;
00138 extern void getnLexemes(int n, char *s, char **ss) MLP_HIDDEN;
00139 extern void getLexemes(char *s,char **ss) MLP_HIDDEN;
00140 extern int LearnAlloc() MLP_HIDDEN;
00141 extern void LearnFree() MLP_HIDDEN;
00142 extern int MLP_PrFFun(char *filename) MLP_HIDDEN;
00143 extern int MLP_PrCFun(char *filename) MLP_HIDDEN;
00144 extern int AllocPatterns(int ifile, int npat, int nin, int nout, int iadd) MLP_HIDDEN;
00145 extern int FreePatterns(int ifile) MLP_HIDDEN;
00146 extern void AllocWeights() MLP_HIDDEN;
00147 extern void FreeWeights() MLP_HIDDEN;
00148 extern int AllocNetwork(int Nlayer, int *Neurons) MLP_HIDDEN;
00149 extern void FreeNetwork() MLP_HIDDEN;
00150 extern int GetNetStructure(char *s, int *Nlayer, int *Nneur) MLP_HIDDEN;
00151 extern int MLP_SetNet(int *nl, int *nn) MLP_HIDDEN;
00152
00153 extern void MLP_MM2rows(dbl* c, type_pat* a, dbl* b,
00154 int Ni, int Nj, int Nk, int NaOffs, int NbOffs) MLP_HIDDEN;
00155 extern void MLP_MatrixVector(dbl *M, type_pat *v, dbl *r, int n,
00156 int m) MLP_HIDDEN;
00157 extern void MLP_MatrixVectorBias(dbl *M, dbl *v, dbl *r, int n,
00158 int m) MLP_HIDDEN;
00159
00160 #ifdef __cplusplus
00161 }
00162 #endif
00163
00164 #endif // __private_mlp_gen_h