This commit is contained in:
novak_99 2022-01-21 17:35:54 -08:00
parent f441780e8a
commit 90f29f8a89
4 changed files with 5 additions and 1 deletions

View File

@ -8,6 +8,7 @@
#include "LinAlg/LinAlg.hpp" #include "LinAlg/LinAlg.hpp"
#include "Activation.hpp" #include "Activation.hpp"
#include <cmath> #include <cmath>
#include <algorithm>
namespace MLPP{ namespace MLPP{
@ -80,7 +81,7 @@ namespace MLPP{
std::vector<double> Activation::adjSoftmax(std::vector<double> z){ std::vector<double> Activation::adjSoftmax(std::vector<double> z){
LinAlg alg; LinAlg alg;
std::vector<double> a; std::vector<double> a;
double C = -*max_element(z.begin(), z.end()); double C = -*std::max_element(z.begin(), z.end());
z = alg.scalarAdd(C, z); z = alg.scalarAdd(C, z);
return softmax(z); return softmax(z);

View File

@ -13,6 +13,7 @@
#include <cmath> #include <cmath>
#include <fstream> #include <fstream>
#include <sstream> #include <sstream>
#include <algorithm>
namespace MLPP{ namespace MLPP{

View File

@ -10,6 +10,7 @@
#include "Utilities/Utilities.hpp" #include "Utilities/Utilities.hpp"
#include <iostream> #include <iostream>
#include <algorithm>
#include <random> #include <random>
namespace MLPP{ namespace MLPP{

View File

@ -9,6 +9,7 @@
#include "LinAlg/LinAlg.hpp" #include "LinAlg/LinAlg.hpp"
#include <iostream> #include <iostream>
#include <algorithm>
#include <random> #include <random>
namespace MLPP{ namespace MLPP{