/* netrbm.cpp - implements methods of class defined in nerbm.h Copyright (C) 2010 Rui Rodrigues This software is released under the terms of the GNU General Public License (http://www.gnu.org/copyleft/gpl.html). */ #include "netrbm.h" netrbm::netrbm(unsigned Ninputs,unsigned Nhidden, unsigned Numcases, unsigned Maxnumthreads, unsigned Blocksize, unsigned Npatches, gsl_vector *Vectorweightsandbias){ ninputs=Ninputs; nhidden=Nhidden; numcases=Numcases; maxnumthreads=Maxnumthreads; blocksize=Blocksize; npatches=Npatches; vectorweightsandbias=Vectorweightsandbias;//just copy the pointer //numcases is batchsize or npatches permutedtdata=gsl_matrix_alloc(npatches,ninputs); posprobs=gsl_matrix_calloc(numcases,nhidden); negprobs=gsl_matrix_calloc(numcases,nhidden); hiddenactivation=gsl_matrix_calloc(numcases,nhidden); batchimagedata=gsl_matrix_calloc(numcases,ninputs); posprods=gsl_matrix_calloc(ninputs,nhidden); negprods=gsl_matrix_calloc(ninputs,nhidden); deltapureweights=gsl_matrix_calloc(ninputs,nhidden); deltavisbias=gsl_vector_alloc(ninputs); deltahidbias=gsl_vector_alloc(nhidden); sizesblocks=new unsigned[maxnumthreads]; for(unsigned i=0;i