File tree Expand file tree Collapse file tree
try1 (OOP Approach)/cpp/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -140,9 +140,10 @@ namespace NeuralNet
140140 printInColor (" | Neural Network |\n " , " 32" );
141141 printInColor (" +-----------------------------------------+\n " , " 32" );
142142
143- std::cout << " Layer Count : " << this ->hidOutLayerCount << endl;
143+ std::cout << " Layer Count : " << this ->hidOutLayerCount + 1 << endl;
144144 printInColor (" Layer Sizes: \n " , " 36" ); // Cyan
145145
146+ std::cout << setw (4 ) << this ->inputLayerSize << " | " ;
146147 for (int i = 0 ; i < this ->hidOutLayerCount ; i++)
147148 {
148149 std::cout << setw (4 ) << this ->hidOutLayerSizes [i]; // Formatting for better spacing
@@ -341,14 +342,13 @@ namespace NeuralNet
341342 void MLP::printParamsCount ()
342343 {
343344 int weightsCount = this ->inputLayerSize ;
345+ int prevLayerNeuronsCount = this ->inputLayerSize ;
344346 int biasesCount = 0 ;
345347
346- for (int i = 1 ; i < this ->hidOutLayerCount ; i++)
347- {
348- weightsCount += this ->hidOutLayerSizes [i] * this ->hidOutLayerSizes [i - 1 ];
349- }
350348 for (int i = 0 ; i < this ->hidOutLayerCount ; i++)
351349 {
350+ weightsCount += this ->hidOutLayerSizes [i] * prevLayerNeuronsCount;
351+ prevLayerNeuronsCount = this ->hidOutLayerSizes [i];
352352 biasesCount += this ->hidOutLayerSizes [i];
353353 }
354354 std::cout << " Weights Count : " << weightsCount << endl;
You can’t perform that action at this time.
0 commit comments