50 likes | 183 Views
Compiling the MLP programs. Create a folder to work in Download ALL .c files to this folder MLPInit.c MLPTrain.c MLPClass.c MLPLib.c MLPReadWrite.c Use Visual Studio .NET command line compiler E.g: cl MLPInit.c cl mlpinit.c will also work. Running the MLP programs.
E N D
Compiling the MLP programs • Create a folder to work in • Download ALL .c files to this folder • MLPInit.c • MLPTrain.c • MLPClass.c • MLPLib.c • MLPReadWrite.c • Use Visual Studio .NET command line compiler • E.g: • cl MLPInit.c • cl mlpinit.c will also work
Running the MLP programs • Start with MLPInit • Make sure mlpconfig is in your current folder • If it’s called mlpconfig.txt, then • EITHER: Change its name to mlpconfig (ren mlpconfig.txt mlpconfig), • OR: edit MLPLib.c, change • if ((config=fopen("mlpconfig","r"))==NULL) , to • if ((config=fopen("mlpconfig.txt","r"))==NULL) • Run program from command line, e.g: • MLPInit 3 5 10 init-3x5x10 • This will create an MLP with 3 input units, 5 hidden units and 10 output units and save it in init-3x5x10
Running the MLP programs • Similarly • run MLPTrain to train your MLP • run MLPClass to use your MLP to classify data • E.G 1 • MLPTrain init pbData_m_f1f2_train.txt 100 trmlp • This will • Use the data in file init to define the initial MLP • Use pbData_m_f1f2_train.txt as training data • Run 100 iterations of the Error Back Propagation algorithm • Put the results in trmlp
Running the MLP programs • Similarly • run MLPClass to use your MLP to classify data • E.G 2 • MLPClass trmlp pbData_m_f1f2_test.txt • This will • Use the data in file trmlp to define the MLP • Use pbData_m_f1f2_test.txt as test data • Print out the error rate
Running the MLP Programs • Make sure mlpconfig is in your folder! • Example mlpconfig • <KSCALE> controls the slope of the sigmoid function (see slide 11 from last week) • <LRATE> controls the learning rate • <MOMENTUM> is the momentum – it controls the ‘stability’ of the learning process • <TRMODE> can either be BATCH or SEQUENTIAL <KSCALE> 1.0 <LRATE> 1.0 <MOMENTUM> 0.0 <TRMODE> BATCH