/* glue2mlps.cpp - create a new mlp putting side by side two mlps 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 #include #include #include "mlp.h" using namespace std; mlp glue2mlps(mlp&mlp1,mlp&mlp2){ if(mlp1.numhidlayers!=mlp2.numhidlayers) throw "numhidlayers are not the same can not glue mlps!"; unsigned numhidlayers=mlp1.numhidlayers; //dimlayers vector dimlayers(numhidlayers+2); for (unsigned i=0;i dimmatrices(2*(numhidlayers+1)); for(unsigned i=0;i< numhidlayers+1;++i){ dimmatrices[2*i]=dimlayers[i]+1;//includes bias dimmatrices[2*i+1]=dimlayers[i+1]; } //mlpmatrix vector mlpmatrix(numhidlayers+1); for(unsigned i=0;i