/* glueseveralmlps.cpp - create a new mlp putting side by side several 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 using namespace std; #include "netdimsandfilenames.h" #include "mlp.h" void checkfstream(ofstream& file_io,const char* filename); //in checkfstream.cpp void checkfstream(ifstream& file_io,const char* filename); //in checkfstream.cpp void read_datafile(ifstream&in,netdimsandfilenames& A); //in netdimsandfilenames.cpp mlp glue2mlps(mlp&mlp1,mlp&mlp2); //in glue2mlps.cpp int main(int argc, char ** argv){ cout<<"arguments must be component signals names, new signal name and finally folder name"<1"< dimlayers(layersdimensions,layersdimensions+5); mlp net0(3,dimlayers); net0.loadtxtweights(A[0].backpropautoencodercoefficientsfile.c_str()); for(unsigned i=1;i1"< dimlayers1(layersdimensions1,layersdimensions1+5); mlp net1(3,dimlayers1); net1.loadtxtweights(A[1].backpropautoencodercoefficientsfile.c_str()); net0=glue2mlps(net0,net1); } //put weights of new mlp in disk b=d; aa=argv[k-2]; b.append(aa); b.append(".txt"); netdimsandfilenames B; ifstream reading(b.c_str()); read_datafile(reading,B); checkfstream(reading,b.c_str()); reading.close(); cout<<"Saving weights on file "<