tinn no longer seeds rng

This commit is contained in:
Gustav Louw 2018-04-01 15:25:47 -07:00
parent bcf16644d2
commit 08ada030cb
2 changed files with 3 additions and 2 deletions

2
Tinn.c
View File

@ -3,7 +3,6 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <math.h> #include <math.h>
#include <time.h>
// Error function. // Error function.
static float err(float a, float b) static float err(float a, float b)
@ -120,7 +119,6 @@ Tinn xtbuild(int nips, int nhid, int nops)
t.nips = nips; t.nips = nips;
t.nhid = nhid; t.nhid = nhid;
t.nops = nops; t.nops = nops;
srand(time(0));
twrand(t); twrand(t);
return t; return t;
} }

3
test.c
View File

@ -1,5 +1,6 @@
#include "Tinn.h" #include "Tinn.h"
#include <stdio.h> #include <stdio.h>
#include <time.h>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
@ -126,6 +127,8 @@ static Data build(const char* path, const int nips, const int nops)
int main() int main()
{ {
// Tinn does not seed the random number generator.
srand(time(0));
// Input and output size is harded coded here as machine learning // Input and output size is harded coded here as machine learning
// repositories usually don't include the input and output size in the data itself. // repositories usually don't include the input and output size in the data itself.
const int nips = 256; const int nips = 256;