Skip to content

Commit 1d69222

Browse files
refactor: fix typo in neural_network.cpp (#2689)
intialize -> initialize Co-authored-by: realstealthninja <[email protected]>
1 parent c84c7da commit 1d69222

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

machine_learning/neural_network.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ class DenseLayer {
136136
* @param neurons number of neurons
137137
* @param activation activation function for layer
138138
* @param kernel_shape shape of kernel
139-
* @param random_kernel flag for whether to intialize kernel randomly
139+
* @param random_kernel flag for whether to initialize kernel randomly
140140
*/
141141
DenseLayer(const int &neurons, const std::string &activation,
142142
const std::pair<size_t, size_t> &kernel_shape,
@@ -502,7 +502,7 @@ class NeuralNetwork {
502502
auto start =
503503
std::chrono::high_resolution_clock::now(); // Start clock
504504
double loss = 0,
505-
acc = 0; // Intialize performance metrics with zero
505+
acc = 0; // Initialize performance metrics with zero
506506
// For each starting index of batch
507507
for (size_t batch_start = 0; batch_start < X.size();
508508
batch_start += batch_size) {
@@ -515,7 +515,7 @@ class NeuralNetwork {
515515
// They will be averaged and applied to kernel
516516
std::vector<std::vector<std::valarray<double>>> gradients;
517517
gradients.resize(this->layers.size());
518-
// First intialize gradients to zero
518+
// First initialize gradients to zero
519519
for (size_t i = 0; i < gradients.size(); i++) {
520520
zeroes_initialization(
521521
gradients[i], get_shape(this->layers[i].kernel));
@@ -606,7 +606,7 @@ class NeuralNetwork {
606606
void evaluate(const std::vector<std::vector<std::valarray<double>>> &X,
607607
const std::vector<std::vector<std::valarray<double>>> &Y) {
608608
std::cout << "INFO: Evaluation Started" << std::endl;
609-
double acc = 0, loss = 0; // intialize performance metrics with zero
609+
double acc = 0, loss = 0; // initialize performance metrics with zero
610610
for (size_t i = 0; i < X.size(); i++) { // For every sample in input
611611
// Get predictions
612612
std::vector<std::valarray<double>> pred =

0 commit comments

Comments
 (0)