23 lines
318 B
C
23 lines
318 B
C
#include "backprop.h"
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
extern layer_size;
|
|
|
|
load(net) BPNN *net;
|
|
{
|
|
float *units;
|
|
int nr, nc, imgsize, i, j, k;
|
|
|
|
nr = layer_size;
|
|
|
|
imgsize = nr * nc;
|
|
units = net->input_units;
|
|
|
|
k = 1;
|
|
for (i = 0; i < nr; i++) {
|
|
units[k] = (float)rand() / RAND_MAX;
|
|
k++;
|
|
}
|
|
}
|