Skip to content

Commit ae8de33

Browse files
feat: add activatios to each layer
1 parent 8d80b20 commit ae8de33

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

try1 (OOP Approach)/cpp/include/NeuralNet/classes.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ class Layer {
1919

2020
public:
2121
Neuron **neurons;
22+
float *activations;
2223
Layer(int size, int prevLayerSize);
2324
~Layer();
2425
void forward_pass(float *inputs, int input_size);

try1 (OOP Approach)/cpp/src/classes.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ Neuron::~Neuron() {
4848
Layer::Layer(int size, int prevLayerSize) {
4949
this->size = size;
5050
this->neurons = new Neuron *[size];
51+
this->activations = new float[size]();
5152

5253
for (int i = 0; i < size; i++) {
5354
this->neurons[i] = new Neuron(prevLayerSize);

0 commit comments

Comments
 (0)