#include #include #include "ad_deriv.h" #include "backprop-Fs-adic-f.ad.c" #define N_SAMPLES 4 #define N_IN 2 #define N_OUT 1 #define LAYERS 2 #define ELEMENTS_LAYER1 2 #define ELEMENTS_LAYER2 1 #define ELEMENTS_LAYER_MAX 2 #define WEIGHTS_LAYER_MAX 6 #define WEIGHTS 3 void vanilla(int n_w0, DERIV_TYPE *w0, int n_layers, struct w_layer *w0_format, int n, double eta) { int i, j, j1; DERIV_TYPE y; double *grad_f, zero[1], one[1]; zero[0] = 0.0; one[0] = 1.0; grad_f = (double *) malloc(n_w0*sizeof(double)); for (i = 0; i