#ifndef MLPP_UTILITIES_OLD_H #define MLPP_UTILITIES_OLD_H // // Utilities.hpp // // Created by Marc Melikyan on 1/16/21. // #include "core/math/math_defs.h" #include #include #include class MLPPUtilitiesOld { public: // Weight Init static std::vector weightInitialization(int n, std::string type = "Default"); static real_t biasInitialization(); static std::vector> weightInitialization(int n, int m, std::string type = "Default"); static std::vector biasInitialization(int n); // Cost/Performance related Functions real_t performance(std::vector y_hat, std::vector y); real_t performance(std::vector> y_hat, std::vector> y); // Parameter Saving Functions void saveParameters(std::string fileName, std::vector weights, real_t bias, bool app = false, int layer = -1); void saveParameters(std::string fileName, std::vector weights, std::vector initial, real_t bias, bool app = false, int layer = -1); void saveParameters(std::string fileName, std::vector> weights, std::vector bias, bool app = false, int layer = -1); // Gradient Descent related static void UI(std::vector weights, real_t bias); static void UI(std::vector weights, std::vector initial, real_t bias); static void UI(std::vector> weights, std::vector bias); static void CostInfo(int epoch, real_t cost_prev, real_t Cost); static std::vector>> createMiniBatches(std::vector> inputSet, int n_mini_batch); static std::tuple>>, std::vector>> createMiniBatches(std::vector> inputSet, std::vector outputSet, int n_mini_batch); static std::tuple>>, std::vector>>> createMiniBatches(std::vector> inputSet, std::vector> outputSet, int n_mini_batch); // F1 score, Precision/Recall, TP, FP, TN, FN, etc. std::tuple TF_PN(std::vector y_hat, std::vector y); //TF_PN = "True", "False", "Positive", "Negative" real_t recall(std::vector y_hat, std::vector y); real_t precision(std::vector y_hat, std::vector y); real_t accuracy(std::vector y_hat, std::vector y); real_t f1_score(std::vector y_hat, std::vector y); }; #endif /* Utilities_hpp */