-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.cpp
More file actions
35 lines (27 loc) · 832 Bytes
/
Copy pathMain.cpp
File metadata and controls
35 lines (27 loc) · 832 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
34
35
#include <iostream>
#include "Node.h"
#include "Link.h"
#include "Layer.h"
#include "Main.h"
//To do:
// Understand the mathematics behind backpropogation.
// Implement backpropogation.
int main() {
// Create layers
Layer inputLayer(new ActivationFunction(), 2);
Layer hiddenLayer(new LeakyReluActivationFunction(), 1);
Layer outputLayer(new ActivationFunction(), 1);
// Connect layers
inputLayer.connect(&hiddenLayer);
hiddenLayer.connect(&outputLayer);
// Propagate signal
double data[2] = {0.5, 0.5};
inputLayer.setData(data, 2);
inputLayer.signal();
std::cout << inputLayer.getLayerNodes()->getData() << std::endl;
hiddenLayer.signal();
std::cout << hiddenLayer.getLayerNodes()->getData() << std::endl;
outputLayer.signal();
std::cout << outputLayer.getLayerNodes()->getData() << std::endl;
return 0;
}