jacobian

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit a925d1e2f1a12f633e731cd9c63ba425ac85e378
parent a42baa478365f43cb37b95844f2fe65d98a51962
Author: David Freifeld <freifeld.david@gmail.com>
Date:   Wed,  1 Jul 2020 18:51:37 -0700

Struggling to defeat evil carriage return

Diffstat:
Mbpnn.cpp | 12++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/bpnn.cpp b/bpnn.cpp @@ -231,11 +231,12 @@ int prep_file(char* path, char* out_path) std::mt19937 g(rd()); std::shuffle(lines.begin(), lines.end(), g); fclose(rptr); - std::ofstream out(out_path); + FILE* wptr = fopen(out_path, "w"); for (int i = 0; i < lines.size(); i++) { - out << lines[i]; + const char* cstr = lines[i].c_str(); + fprintf(wptr,"%s", cstr); } - out.close(); + fclose(wptr); return count; } @@ -273,10 +274,13 @@ float Network::test(char* path) int label = -1; for (int i = 0; i < batch_size; i++) { fgets(line, MAXLINE, data); - printf("%s", line); + printf("Next line: %s\n", line); char *p; p = strtok(line,","); + printf("Finish strtok\n"); for (int j = 0; j < inputs; j++) { + printf("%s\n", p); + printf("Enter strtod loop\n"); batch[j + (i * inputs)] = strtod(p, NULL); p = strtok(NULL,","); }