forked from GavinTechStudio/Back-Propagation-Neural-Network
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
33 lines (25 loc) · 746 Bytes
/
main.cpp
File metadata and controls
33 lines (25 loc) · 746 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/**
* @author Gavin
* @date 2022/2/10
* @Email gavinsun0921@foxmail.com
*/
#include <iostream>
#include "lib/Net.h"
#include "lib/Utils.h"
using std::cout;
using std::endl;
int main(int argc, char *argv[]) {
// Create neural network object
Net net;
// Read training data
const vector<Sample> trainDataSet = Utils::getTrainData("../data/traindata.txt");
// Training neural network
net.train(trainDataSet);
// Prediction of samples using neural network
const vector<Sample> testDataSet = Utils::getTestData("../data/testdata.txt");
vector<Sample> predSet = net.predict(testDataSet);
for (auto &pred: predSet) {
pred.display();
}
return 0;
}