-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNeuralNet.h
More file actions
73 lines (55 loc) · 1.16 KB
/
NeuralNet.h
File metadata and controls
73 lines (55 loc) · 1.16 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*
* NeuralNet.h
*
* Created on: Jun 5, 2014
* Author: shaun
*/
#ifndef NEURALNET_H_
#define NEURALNET_H_
#include <ctime>
#include <iostream>
using std::cout;
using std::endl;
#include <vector>
using std::vector;
#include <algorithm>
using std::swap;
#include <memory>
using std::shared_ptr;
#include "Synapse.h"
namespace NN
{
class NeuralNet
{
public:
NeuralNet(const vector<size_t>& node_structure, const shared_ptr<Synapse>);
NeuralNet(const NeuralNet&);
virtual
~NeuralNet();
virtual vector<size_t>
structure() const;
virtual float
evaluate(const vector<float>& inputs);
protected:
vector<vector<float>> m_nodes;
vector<float> m_weights;
shared_ptr<Synapse> m_synapse;
};
class CheckersNet : public NeuralNet
{
public:
enum Player {BLACK, RED};
CheckersNet(const vector<size_t>& node_structure, shared_ptr<Synapse>);
CheckersNet(CheckersNet&);
virtual float
evaluate(const vector<float>& inputs);
virtual void
player(Player color);
private:
float m_king;
Player m_player;
float m_MAX;
float m_MIN;
};
} // namespace NN
#endif /* NEURALNET_H_ */