I'm trying to build a multi-layer perceptron network in c++ using visual studio 2013. First I create a struct for the neutrons of the first layer but when I run it gives me a stack overflow error. This is my code:
#include "stdafx.h"
#include <iostream>
#include <math.h>
#include <fstream>
#include <vector>
// Number of Neurons
#define INPUTS 784
#define INPNEUR 784
#define HIDNEUR 500
#define OUTNEUR 10
struct inpneuron {
int number;
double weights[INPUTS];
double bias;
double inputs[INPUTS];
double output;
double delta;
};
typedef struct inpneuron InpNeuron;
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
int i, j, x[INPUTS];
InpNeuron InputLayer[INPNEUR];
system("PAUSE");
return 0;
}
And the exception it gives is: Unhandled exception at 0x00302CB7 in Multi Layer Perceptron MNIST.exe: 0xC00000FD: Stack overflow (parameters: 0x00000000, 0x00522000).
I have very little experience in programming but I think it's a memory problem because when I decrease the number of neurons or inputs it works. Is there any way I can make it work with this number of neurons and inputs?