mirror of
https://github.com/glouw/tinn
synced 2024-11-21 22:11:21 +03:00
use standard %f format (%a seems less portable)
This commit is contained in:
parent
e92adf34e8
commit
a9e85f354a
8
Tinn.c
8
Tinn.c
@ -165,8 +165,8 @@ void xtsave(const Tinn t, const char* const path)
|
|||||||
// Header.
|
// Header.
|
||||||
fprintf(file, "%d %d %d\n", t.nips, t.nhid, t.nops);
|
fprintf(file, "%d %d %d\n", t.nips, t.nhid, t.nops);
|
||||||
// Biases and weights.
|
// Biases and weights.
|
||||||
for(int i = 0; i < t.nb; i++) fprintf(file, "%a\n", (double) t.b[i]);
|
for(int i = 0; i < t.nb; i++) fprintf(file, "%f\n", (double) t.b[i]);
|
||||||
for(int i = 0; i < t.nw; i++) fprintf(file, "%a\n", (double) t.w[i]);
|
for(int i = 0; i < t.nw; i++) fprintf(file, "%f\n", (double) t.w[i]);
|
||||||
fclose(file);
|
fclose(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -182,8 +182,8 @@ Tinn xtload(const char* const path)
|
|||||||
// A new tinn is returned.
|
// A new tinn is returned.
|
||||||
const Tinn t = xtbuild(nips, nhid, nops);
|
const Tinn t = xtbuild(nips, nhid, nops);
|
||||||
// Biases and weights.
|
// Biases and weights.
|
||||||
for(int i = 0; i < t.nb; i++) fscanf(file, "%a\n", &t.b[i]);
|
for(int i = 0; i < t.nb; i++) fscanf(file, "%f\n", &t.b[i]);
|
||||||
for(int i = 0; i < t.nw; i++) fscanf(file, "%a\n", &t.w[i]);
|
for(int i = 0; i < t.nw; i++) fscanf(file, "%f\n", &t.w[i]);
|
||||||
fclose(file);
|
fclose(file);
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user