Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
dx removed and code working
Seems to work really well with 2000 iterations.
- Loading branch information
Showing
10 changed files
with
4,163 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#include <iostream> | ||
#include <fstream> | ||
#include <vector> | ||
#include <string> | ||
|
||
using namespace std; | ||
|
||
int main( void ) | ||
{ | ||
string filename = "train_imgs_0_1_900dim.mat"; | ||
std::fstream file(filename.c_str()); | ||
|
||
std::vector<std::string> vec; | ||
|
||
int counter =0; | ||
|
||
while (!file.eof()) { | ||
|
||
std::string aux; | ||
getline(file, aux); | ||
vec.push_back(aux); | ||
} | ||
|
||
std::fstream newfile("train_imgs_0_1_900dimMixed20.mat"); | ||
std::fstream newfilelabel("train_labels_0_1_900dimMixed20.mat"); | ||
|
||
int half = 100; | ||
|
||
for (int k = 0; k < 10; ++k) | ||
{ | ||
/* code */ | ||
for (int i = 0; i < 5; ++i) | ||
{ | ||
int tw = 20*i; | ||
for (int j = 0; j < 20; ++j) | ||
{ | ||
newfile << vec[tw + j] << std::endl; | ||
newfilelabel << "0" << std::endl; | ||
} | ||
for (int j = 0; j < 20; ++j) | ||
{ | ||
newfile << vec[tw + j +half] << std::endl; | ||
newfilelabel << "1" << std::endl; | ||
} | ||
} | ||
} | ||
/* | ||
for (int i = 0; i + half < 200 ; ++i) | ||
{ | ||
newfile << vec[i] << std::endl; | ||
newfile << vec[i+half] << std::endl; | ||
newfilelabel << "0" << std::endl; | ||
newfilelabel << "1" << std::endl; | ||
} | ||
for (int i = 0; i + half < 200 ; ++i) | ||
{ | ||
newfile << vec[i] << std::endl; | ||
newfile << vec[i+half] << std::endl; | ||
newfilelabel << "0" << std::endl; | ||
newfilelabel << "1" << std::endl; | ||
} | ||
*/ | ||
return 0; | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
1.0 0.0 | ||
0.0 1.0 | ||
0.0 0.0 | ||
1.0 1.0 |
Oops, something went wrong.