-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNetwork.h
More file actions
33 lines (24 loc) · 766 Bytes
/
Copy pathNetwork.h
File metadata and controls
33 lines (24 loc) · 766 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
#pragma once
#include "Matrix.h"
#include <vector>
#include <cmath>
class Network
{
friend class Genome;
public:
Network();
Network(const Network& other);
Network(size_t layer, size_t* sizes);
void FeedForward(const Matrix& input); //feedforward the input, update activations
Matrix GetOutput(); //return the last member of activations
std::vector<Matrix> GetWeights(); //return the weight matrices
Network& operator=(const Network& other);
void DisplayWeights();
void DisplayActivations();
static std::vector<Network> Batch(size_t layer, size_t* sizes, size_t number); //creates "number" networks based on the same template
private:
std::vector<Matrix> weights;
std::vector<Matrix> bias;
std::vector<Matrix> activations;
size_t layer;
};