#ifndef MLPP_ACTIVATION_H #define MLPP_ACTIVATION_H // // Activation.hpp // // Created by Marc Melikyan on 1/16/21. // #include class MLPPActivation { public: double linear(double z, bool deriv = 0); std::vector linear(std::vector z, bool deriv = 0); std::vector> linear(std::vector> z, bool deriv = 0); double sigmoid(double z, bool deriv = 0); std::vector sigmoid(std::vector z, bool deriv = 0); std::vector> sigmoid(std::vector> z, bool deriv = 0); std::vector softmax(std::vector z, bool deriv = 0); std::vector> softmax(std::vector> z, bool deriv = 0); std::vector adjSoftmax(std::vector z); std::vector> adjSoftmax(std::vector> z); std::vector> softmaxDeriv(std::vector z); std::vector>> softmaxDeriv(std::vector> z); double softplus(double z, bool deriv = 0); std::vector softplus(std::vector z, bool deriv = 0); std::vector> softplus(std::vector> z, bool deriv = 0); double softsign(double z, bool deriv = 0); std::vector softsign(std::vector z, bool deriv = 0); std::vector> softsign(std::vector> z, bool deriv = 0); double gaussianCDF(double z, bool deriv = 0); std::vector gaussianCDF(std::vector z, bool deriv = 0); std::vector> gaussianCDF(std::vector> z, bool deriv = 0); double cloglog(double z, bool deriv = 0); std::vector cloglog(std::vector z, bool deriv = 0); std::vector> cloglog(std::vector> z, bool deriv = 0); double logit(double z, bool deriv = 0); std::vector logit(std::vector z, bool deriv = 0); std::vector> logit(std::vector> z, bool deriv = 0); double unitStep(double z, bool deriv = 0); std::vector unitStep(std::vector z, bool deriv = 0); std::vector> unitStep(std::vector> z, bool deriv = 0); double swish(double z, bool deriv = 0); std::vector swish(std::vector z, bool deriv = 0); std::vector> swish(std::vector> z, bool deriv = 0); double mish(double z, bool deriv = 0); std::vector mish(std::vector z, bool deriv = 0); std::vector> mish(std::vector> z, bool deriv = 0); double sinc(double z, bool deriv = 0); std::vector sinc(std::vector z, bool deriv = 0); std::vector> sinc(std::vector> z, bool deriv = 0); double RELU(double z, bool deriv = 0); std::vector RELU(std::vector z, bool deriv = 0); std::vector> RELU(std::vector> z, bool deriv = 0); double leakyReLU(double z, double c, bool deriv = 0); std::vector leakyReLU(std::vector z, double c, bool deriv = 0); std::vector> leakyReLU(std::vector> z, double c, bool deriv = 0); double ELU(double z, double c, bool deriv = 0); std::vector ELU(std::vector z, double c, bool deriv = 0); std::vector> ELU(std::vector> z, double c, bool deriv = 0); double SELU(double z, double lambda, double c, bool deriv = 0); std::vector SELU(std::vector z, double lambda, double c, bool deriv = 0); std::vector> SELU(std::vector>, double lambda, double c, bool deriv = 0); double GELU(double z, bool deriv = 0); std::vector GELU(std::vector z, bool deriv = 0); std::vector> GELU(std::vector> z, bool deriv = 0); double sign(double z, bool deriv = 0); std::vector sign(std::vector z, bool deriv = 0); std::vector> sign(std::vector> z, bool deriv = 0); double sinh(double z, bool deriv = 0); std::vector sinh(std::vector z, bool deriv = 0); std::vector> sinh(std::vector> z, bool deriv = 0); double cosh(double z, bool deriv = 0); std::vector cosh(std::vector z, bool deriv = 0); std::vector> cosh(std::vector> z, bool deriv = 0); double tanh(double z, bool deriv = 0); std::vector tanh(std::vector z, bool deriv = 0); std::vector> tanh(std::vector> z, bool deriv = 0); double csch(double z, bool deriv = 0); std::vector csch(std::vector z, bool deriv = 0); std::vector> csch(std::vector> z, bool deriv = 0); double sech(double z, bool deriv = 0); std::vector sech(std::vector z, bool deriv = 0); std::vector> sech(std::vector> z, bool deriv = 0); double coth(double z, bool deriv = 0); std::vector coth(std::vector z, bool deriv = 0); std::vector> coth(std::vector> z, bool deriv = 0); double arsinh(double z, bool deriv = 0); std::vector arsinh(std::vector z, bool deriv = 0); std::vector> arsinh(std::vector> z, bool deriv = 0); double arcosh(double z, bool deriv = 0); std::vector arcosh(std::vector z, bool deriv = 0); std::vector> arcosh(std::vector> z, bool deriv = 0); double artanh(double z, bool deriv = 0); std::vector artanh(std::vector z, bool deriv = 0); std::vector> artanh(std::vector> z, bool deriv = 0); double arcsch(double z, bool deriv = 0); std::vector arcsch(std::vector z, bool deriv = 0); std::vector> arcsch(std::vector> z, bool deriv = 0); double arsech(double z, bool deriv = 0); std::vector arsech(std::vector z, bool deriv = 0); std::vector> arsech(std::vector> z, bool deriv = 0); double arcoth(double z, bool deriv = 0); std::vector arcoth(std::vector z, bool deriv = 0); std::vector> arcoth(std::vector> z, bool deriv = 0); std::vector activation(std::vector z, bool deriv, double (*function)(double, bool)); private: }; #endif /* Activation_hpp */