55 return rand() % (hi - low + 1) + low;
60 return ((
long double)rand() / RAND_MAX) * (hi - low) + low;
65 : num_layers(0), layer_ptr(0), _MSE(0.0), _MAE(0.0), _Eta(0.25),
66 _Alpha(0.9), _Gain(1.0), _AvgTestError(0.0) {
67 int64_t _LAYER, _NEURON;
74 for (_LAYER = 0; _LAYER < nl; _LAYER++) {
80 for (_NEURON = 0; _NEURON < npl[_LAYER]; _NEURON++) {
92 new long double[npl[_LAYER - 1]];
95 new long double[npl[_LAYER - 1]];
98 new long double[npl[_LAYER - 1]];
116 int64_t _LAYER, _NEURON;
120 for (_LAYER = 0; _LAYER < num_layers; _LAYER++) {
121 if (layer_ptr[_LAYER].neuron_ptr) {
122 for (_NEURON = 0; _NEURON < layer_ptr[_LAYER].num_neurons;
124 if (layer_ptr[_LAYER].neuron_ptr[_NEURON].wt) {
125 delete[] layer_ptr[_LAYER].neuron_ptr[_NEURON].wt;
128 if (layer_ptr[_LAYER].neuron_ptr[_NEURON].wt_last) {
129 delete[] layer_ptr[_LAYER].neuron_ptr[_NEURON].wt_last;
132 if (layer_ptr[_LAYER].neuron_ptr[_NEURON].wt_saved) {
133 delete[] layer_ptr[_LAYER].neuron_ptr[_NEURON].wt_saved;
137 delete[] layer_ptr[_LAYER].neuron_ptr;
PrimaryMLP(int64_t nl, int64_t npl[])
long double rand_real(long double low, long double hi)
int64_t rand_int(int64_t low, int64_t hi)
Namespace for openGPMP Machine Learning.