From a5a4de4aace1f35912c7712d4e7958cf87d8f67f Mon Sep 17 00:00:00 2001 From: Ikko Eltociear Ashimine Date: Mon, 15 Apr 2024 11:17:10 +0900 Subject: [PATCH] refactor: fix typo in neural_network.cpp intialize -> initialize --- machine_learning/neural_network.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/machine_learning/neural_network.cpp b/machine_learning/neural_network.cpp index 978d658b456..7e20f7a4022 100644 --- a/machine_learning/neural_network.cpp +++ b/machine_learning/neural_network.cpp @@ -136,7 +136,7 @@ class DenseLayer { * @param neurons number of neurons * @param activation activation function for layer * @param kernel_shape shape of kernel - * @param random_kernel flag for whether to intialize kernel randomly + * @param random_kernel flag for whether to initialize kernel randomly */ DenseLayer(const int &neurons, const std::string &activation, const std::pair &kernel_shape, @@ -502,7 +502,7 @@ class NeuralNetwork { auto start = std::chrono::high_resolution_clock::now(); // Start clock double loss = 0, - acc = 0; // Intialize performance metrics with zero + acc = 0; // Initialize performance metrics with zero // For each starting index of batch for (size_t batch_start = 0; batch_start < X.size(); batch_start += batch_size) { @@ -515,7 +515,7 @@ class NeuralNetwork { // They will be averaged and applied to kernel std::vector>> gradients; gradients.resize(this->layers.size()); - // First intialize gradients to zero + // First initialize gradients to zero for (size_t i = 0; i < gradients.size(); i++) { zeroes_initialization( gradients[i], get_shape(this->layers[i].kernel)); @@ -606,7 +606,7 @@ class NeuralNetwork { void evaluate(const std::vector>> &X, const std::vector>> &Y) { std::cout << "INFO: Evaluation Started" << std::endl; - double acc = 0, loss = 0; // intialize performance metrics with zero + double acc = 0, loss = 0; // initialize performance metrics with zero for (size_t i = 0; i < X.size(); i++) { // For every sample in input // Get predictions std::vector> pred =