Copyright (C) Kevin Larke 2009-2020

This file is part of libcm.

libcm is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

libcm is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

See the GNU General Public License distributed with the libcm package or look here: .


cmRbm : Restricted Bolzmann Machine object.
enum
{
  kOkRbmRC = cmOkRC,
  kInvalidParmRbmRC,
  kStackFailRbmRC,
  kMonitorWrFailRbmRC
};

typedef cmHandle_t cmRbmH_t;
typedef cmRC_t     cmRbmRC_t;

extern cmRbmH_t cmRbmNullHandle;

cmRbmRC_t cmRbmAllocate( cmCtx_t* ctx, cmRbmH_t* hp, const unsigned nodesPerLayer[], unsigned layerCnt );
cmRbmRC_t cmRbmFree( cmRbmH_t* hp );
bool      cmRbmIsValid( cmRbmH_t h );

cmRbmRC_t cmRbmConfigure( cmRbmH_t h, const unsigned nodesPerLayerV[], unsigned layerCnt );  

typedef struct
{
  double maxX;
  double minX;
  double initW;  
  double eta;        // learning rate
  double holdOutFrac; 
  unsigned epochCnt;
  unsigned batchCnt;
  double momentum;
} cmRbmTrainParms_t;

void cmRbmBinaryTest(cmCtx_t* ctx);