#ifndef MLPP_COST_H #define MLPP_COST_H // // Cost.hpp // // Created by Marc Melikyan on 1/16/21. // #include "core/math/math_defs.h" #include class MLPPCost { public: // Regression Costs real_t MSE(std::vector y_hat, std::vector y); real_t MSE(std::vector> y_hat, std::vector> y); std::vector MSEDeriv(std::vector y_hat, std::vector y); std::vector> MSEDeriv(std::vector> y_hat, std::vector> y); real_t RMSE(std::vector y_hat, std::vector y); real_t RMSE(std::vector> y_hat, std::vector> y); std::vector RMSEDeriv(std::vector y_hat, std::vector y); std::vector> RMSEDeriv(std::vector> y_hat, std::vector> y); real_t MAE(std::vector y_hat, std::vector y); real_t MAE(std::vector> y_hat, std::vector> y); std::vector MAEDeriv(std::vector y_hat, std::vector y); std::vector> MAEDeriv(std::vector> y_hat, std::vector> y); real_t MBE(std::vector y_hat, std::vector y); real_t MBE(std::vector> y_hat, std::vector> y); std::vector MBEDeriv(std::vector y_hat, std::vector y); std::vector> MBEDeriv(std::vector> y_hat, std::vector> y); // Classification Costs real_t LogLoss(std::vector y_hat, std::vector y); real_t LogLoss(std::vector> y_hat, std::vector> y); std::vector LogLossDeriv(std::vector y_hat, std::vector y); std::vector> LogLossDeriv(std::vector> y_hat, std::vector> y); real_t CrossEntropy(std::vector y_hat, std::vector y); real_t CrossEntropy(std::vector> y_hat, std::vector> y); std::vector CrossEntropyDeriv(std::vector y_hat, std::vector y); std::vector> CrossEntropyDeriv(std::vector> y_hat, std::vector> y); real_t HuberLoss(std::vector y_hat, std::vector y, real_t delta); real_t HuberLoss(std::vector> y_hat, std::vector> y, real_t delta); std::vector HuberLossDeriv(std::vector y_hat, std::vector y, real_t delta); std::vector> HuberLossDeriv(std::vector> y_hat, std::vector> y, real_t delta); real_t HingeLoss(std::vector y_hat, std::vector y); real_t HingeLoss(std::vector> y_hat, std::vector> y); std::vector HingeLossDeriv(std::vector y_hat, std::vector y); std::vector> HingeLossDeriv(std::vector> y_hat, std::vector> y); real_t HingeLoss(std::vector y_hat, std::vector y, std::vector weights, real_t C); real_t HingeLoss(std::vector> y_hat, std::vector> y, std::vector> weights, real_t C); std::vector HingeLossDeriv(std::vector y_hat, std::vector y, real_t C); std::vector> HingeLossDeriv(std::vector> y_hat, std::vector> y, real_t C); real_t WassersteinLoss(std::vector y_hat, std::vector y); real_t WassersteinLoss(std::vector> y_hat, std::vector> y); std::vector WassersteinLossDeriv(std::vector y_hat, std::vector y); std::vector> WassersteinLossDeriv(std::vector> y_hat, std::vector> y); real_t dualFormSVM(std::vector alpha, std::vector> X, std::vector y); // TO DO: DON'T forget to add non-linear kernelizations. std::vector dualFormSVMDeriv(std::vector alpha, std::vector> X, std::vector y); private: }; #endif /* Cost_hpp */