45 lines
787 B
C++
45 lines
787 B
C++
#pragma once
|
|
|
|
#include <vector>
|
|
|
|
namespace NeuralNetwork {
|
|
namespace ProblemSets {
|
|
typedef std::pair<std::vector<float>, std::vector<float>> TrainingPattern;
|
|
|
|
std::vector<TrainingPattern> Parity3() {
|
|
return {
|
|
{{0,0,0},{0}},
|
|
{{0,0,1},{1}},
|
|
{{0,1,0},{1}},
|
|
{{0,1,1},{0}},
|
|
{{1,0,0},{1}},
|
|
{{1,0,1},{0}},
|
|
{{1,1,0},{0}},
|
|
{{1,1,1},{1}},
|
|
};
|
|
}
|
|
|
|
std::vector<TrainingPattern> Parity4() {
|
|
return {
|
|
{{0,0,0,0},{0}},
|
|
{{0,0,0,1},{1}},
|
|
{{0,0,1,0},{1}},
|
|
{{0,0,1,1},{0}},
|
|
{{0,1,0,0},{1}},
|
|
{{0,1,0,1},{0}},
|
|
{{0,1,1,0},{0}},
|
|
{{0,1,1,1},{1}},
|
|
{{1,0,0,0},{1}},
|
|
{{1,0,0,1},{0}},
|
|
{{1,0,1,0},{0}},
|
|
{{1,0,1,1},{1}},
|
|
{{1,1,0,0},{0}},
|
|
{{1,1,0,1},{1}},
|
|
{{1,1,1,0},{1}},
|
|
{{1,1,1,1},{0}},
|
|
};
|
|
}
|
|
|
|
|
|
}
|
|
} |