parity problem set

This commit is contained in:
2016-05-17 22:27:50 +02:00
parent e4f5cdcb00
commit 86def08f41

View File

@@ -0,0 +1,45 @@
#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}},
};
}
}
}