-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathHiddenLayer.h
More file actions
30 lines (27 loc) · 800 Bytes
/
HiddenLayer.h
File metadata and controls
30 lines (27 loc) · 800 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
#pragma once
#include "Matrix.h"
#include "Math.h"
class HiddenLayer
{
public:
HiddenLayer(string activation, int inputSize, int neurons, vector<float> valuesRange);
~HiddenLayer();
void InitializeWeights(int numberOfSamples);
void InitializeBiases(int numberOfSamples);
Matrix GetWeights();
void UpdateWeights(Matrix matrix);
Matrix GetBiases();
void UpdateBiases(Matrix matrix);
Matrix ApplyActivation(Matrix hiddenLayerInput);
Matrix ApplyDerivative(Matrix hiddenLayerActivations);
int GetNeurons();
private:
vector<float> valuesRange;
Matrix weights;
Matrix biases;
string activation;
int inputSize;
int neurons;
vector <float> GenerateRandomVector(int numberOfSamples);
vector <float> GenerateRandomVector_Repetitives(int numberOfSamples);
};