00001 #ifndef __BNLEARN_ENGINE_H__
00002 #define __BNLEARN_ENGINE_H__
00003
00004 #include "vfml.h"
00005
00036 typedef enum BNLAction_ {BNL_NO_CHANGE, BNL_ADDED_PARENT, BNL_REMOVED_PARENT, BNL_REVERSED_PARENT} BNLAction;
00037
00038
00039
00040 typedef struct BNLearnCallbackAPI_ {
00041
00042
00043 void (*NetInit)(void **user, BeliefNet newBn, BeliefNet oldBn, BNLAction action, int childId, int parentId);
00044 void (*NetFree)(void **user, BeliefNet bn);
00045 void (*NodeUpdateBD)(void **user, BeliefNetNode bnn,
00046 float **add_eventCounts, float *add_rowCounts);
00047 } BNLearnCallbackAPI;
00048
00049
00050
00051
00052 typedef struct BNLearnParams_ {
00053
00054 VoidListPtr gDataMemory;
00055 FILE *gDataFile;
00056
00057
00058 BeliefNet gInputNetMemory;
00059 FILE *gInputNetFile;
00060 ExampleSpecPtr gInputNetEmptySpec;
00061
00062
00063 char *gOutputNetFilename;
00064 int gOutputNetToMemory;
00065 BeliefNet gOutputNetMemory;
00066
00067
00068 long gLimitBytes;
00069 double gLimitSeconds;
00070 int gNoReverse;
00071 double gKappa;
00072 int gOnlyEstimateParameters;
00073 int gMaxSearchSteps;
00074 int gMaxParentsPerNode;
00075 int gMaxParameterGrowthMult;
00076 long gMaxParameterCount;
00077 int gSeed;
00078 double gSmoothAmount;
00079 int gCheckModelCycle;
00080 BNLearnCallbackAPI *gCallbackAPI;
00081 } BNLearnParams;
00082
00083
00084
00086 BNLearnParams *BNLearn_NewParams();
00087
00093 void BNLearn_FreeParams(BNLearnParams *params);
00094
00096 void BNLearn(BNLearnParams *params);
00097
00098
00099 #endif
00100