Skip to content

Commit 745ae45

Browse files
author
Juan Montesinos
committed
Comments
1 parent fbb5e72 commit 745ae45

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

include/activations.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class ReLu : public Module
1111
std::vector<float> backward(const std::vector<float> &grad_output) override;
1212
void update(float lr) override;
1313
private:
14-
std::vector<bool> zeroed;
14+
std::vector<bool> zeroed; // Store for backpropagation
1515
};
1616

1717
#endif

include/modules.h

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ class LinearLayer : public Module
1919
vector<float> forward(const vector<float> &input) override;
2020
vector<float> backward(const vector<float> &grad_output) override;
2121
void update(float lr) override;
22+
23+
// Expose weights and biases for comparison
2224
vector<vector<float>> weights;
2325
vector<float> bias;
2426
vector<vector<float>> grad_weights;
@@ -28,6 +30,7 @@ class LinearLayer : public Module
2830
int input_size;
2931
int output_size;
3032

33+
// Store input for backward pass
3134
vector<float> input;
3235
};
3336

0 commit comments

Comments
 (0)