-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNNet.h
More file actions
25 lines (19 loc) · 696 Bytes
/
NNet.h
File metadata and controls
25 lines (19 loc) · 696 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
#pragma once
#include <array>
#include <vector>
class NNet
{
public:
NNet(unsigned int num_of_layers, unsigned int num_of_neurons, unsigned int num_of_inputs,
unsigned int num_of_outputs);
std::vector<float> feed_forward(std::vector<float> input);
private:
float feed_neuron(std::vector<float>::const_iterator weights_begin, std::vector<float> inputs);
std::vector<float> feed_layer(std::vector<float>::const_iterator weights_begin, std::vector<float> inputs);
float sigmoid(float x);
unsigned int num_of_layers;
unsigned int num_of_neurons;
std::vector<float> input_layer;
std::vector<float> output_layer;
std::vector<float> weights;
};