-
Notifications
You must be signed in to change notification settings - Fork 0
/
Layer.h
25 lines (21 loc) · 838 Bytes
/
Layer.h
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 "Neuron.h"
#include <vector>
#include "ActivationFunction.h"
#include "CostFunction.h"
class Layer
{
public:
Layer(int numberOfInputs, int numberOfOutputs, ActivationFunction& activationFunction);
vector<double> ForwardPass(const vector<double>& inputs);
vector<double> BackwardPassOutputLayer(vector<double> &previousLayerActivations, vector<double> ¤tLayerActivations,
vector<double> expectedOutputs, CostFunction &cost);
vector<double> BackwardPassHiddenLayer(vector<double> &previousLayerActivations, vector<double> ¤tLayerActivations,
vector<double> &nextLayerPartialDerivatives, Layer &nextLayer);
void ApplyGradientsToWeights(double scalingFactor);
private:
int numberOfInputs;
int numberOfNeurons;
ActivationFunction& activationFunction;
vector<Neuron> neurons;
};