// Generated by using Rcpp::compileAttributes() -> do not edit by hand
// Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#include <Rcpp.h>

using namespace Rcpp;

// applyDropoutMaskCpp
NumericMatrix applyDropoutMaskCpp(NumericMatrix data, NumericVector mask);
RcppExport SEXP _darch_applyDropoutMaskCpp(SEXP dataSEXP, SEXP maskSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type data(dataSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type mask(maskSEXP);
    rcpp_result_gen = Rcpp::wrap(applyDropoutMaskCpp(data, mask));
    return rcpp_result_gen;
END_RCPP
}
// ditherCpp
NumericMatrix ditherCpp(NumericMatrix data, NumericVector columnMask);
RcppExport SEXP _darch_ditherCpp(SEXP dataSEXP, SEXP columnMaskSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type data(dataSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type columnMask(columnMaskSEXP);
    rcpp_result_gen = Rcpp::wrap(ditherCpp(data, columnMask));
    return rcpp_result_gen;
END_RCPP
}
// exponentialLinearUnitCpp
List exponentialLinearUnitCpp(NumericMatrix input, double alpha);
RcppExport SEXP _darch_exponentialLinearUnitCpp(SEXP inputSEXP, SEXP alphaSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type input(inputSEXP);
    Rcpp::traits::input_parameter< double >::type alpha(alphaSEXP);
    rcpp_result_gen = Rcpp::wrap(exponentialLinearUnitCpp(input, alpha));
    return rcpp_result_gen;
END_RCPP
}
// maxoutUnitCppParallel
void maxoutUnitCppParallel(NumericMatrix activations, NumericMatrix derivatives, const int poolSize, const NumericVector dropoutMask);
RcppExport SEXP _darch_maxoutUnitCppParallel(SEXP activationsSEXP, SEXP derivativesSEXP, SEXP poolSizeSEXP, SEXP dropoutMaskSEXP) {
BEGIN_RCPP
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type activations(activationsSEXP);
    Rcpp::traits::input_parameter< NumericMatrix >::type derivatives(derivativesSEXP);
    Rcpp::traits::input_parameter< const int >::type poolSize(poolSizeSEXP);
    Rcpp::traits::input_parameter< const NumericVector >::type dropoutMask(dropoutMaskSEXP);
    maxoutUnitCppParallel(activations, derivatives, poolSize, dropoutMask);
    return R_NilValue;
END_RCPP
}
// maxoutUnitCpp
void maxoutUnitCpp(NumericMatrix activations, NumericMatrix derivatives, int poolSize, NumericVector dropoutMask);
RcppExport SEXP _darch_maxoutUnitCpp(SEXP activationsSEXP, SEXP derivativesSEXP, SEXP poolSizeSEXP, SEXP dropoutMaskSEXP) {
BEGIN_RCPP
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type activations(activationsSEXP);
    Rcpp::traits::input_parameter< NumericMatrix >::type derivatives(derivativesSEXP);
    Rcpp::traits::input_parameter< int >::type poolSize(poolSizeSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type dropoutMask(dropoutMaskSEXP);
    maxoutUnitCpp(activations, derivatives, poolSize, dropoutMask);
    return R_NilValue;
END_RCPP
}
// maxoutWeightUpdateCpp
void maxoutWeightUpdateCpp(NumericMatrix inc, int poolSize);
RcppExport SEXP _darch_maxoutWeightUpdateCpp(SEXP incSEXP, SEXP poolSizeSEXP) {
BEGIN_RCPP
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type inc(incSEXP);
    Rcpp::traits::input_parameter< int >::type poolSize(poolSizeSEXP);
    maxoutWeightUpdateCpp(inc, poolSize);
    return R_NilValue;
END_RCPP
}
// minimizeCpp
List minimizeCpp(NumericVector x, Function f, int length, double red, List dims, NumericMatrix data, NumericMatrix target, int epochSwitch, Function matMult);
RcppExport SEXP _darch_minimizeCpp(SEXP xSEXP, SEXP fSEXP, SEXP lengthSEXP, SEXP redSEXP, SEXP dimsSEXP, SEXP dataSEXP, SEXP targetSEXP, SEXP epochSwitchSEXP, SEXP matMultSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP);
    Rcpp::traits::input_parameter< Function >::type f(fSEXP);
    Rcpp::traits::input_parameter< int >::type length(lengthSEXP);
    Rcpp::traits::input_parameter< double >::type red(redSEXP);
    Rcpp::traits::input_parameter< List >::type dims(dimsSEXP);
    Rcpp::traits::input_parameter< NumericMatrix >::type data(dataSEXP);
    Rcpp::traits::input_parameter< NumericMatrix >::type target(targetSEXP);
    Rcpp::traits::input_parameter< int >::type epochSwitch(epochSwitchSEXP);
    Rcpp::traits::input_parameter< Function >::type matMult(matMultSEXP);
    rcpp_result_gen = Rcpp::wrap(minimizeCpp(x, f, length, red, dims, data, target, epochSwitch, matMult));
    return rcpp_result_gen;
END_RCPP
}
// normalizeWeightsCpp
void normalizeWeightsCpp(NumericMatrix weights, float bound);
RcppExport SEXP _darch_normalizeWeightsCpp(SEXP weightsSEXP, SEXP boundSEXP) {
BEGIN_RCPP
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type weights(weightsSEXP);
    Rcpp::traits::input_parameter< float >::type bound(boundSEXP);
    normalizeWeightsCpp(weights, bound);
    return R_NilValue;
END_RCPP
}
// rectifiedLinearUnitCpp
List rectifiedLinearUnitCpp(NumericMatrix input);
RcppExport SEXP _darch_rectifiedLinearUnitCpp(SEXP inputSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type input(inputSEXP);
    rcpp_result_gen = Rcpp::wrap(rectifiedLinearUnitCpp(input));
    return rcpp_result_gen;
END_RCPP
}
// rpropGradientsCpp
void rpropGradientsCpp(NumericMatrix gg, NumericMatrix gradients);
RcppExport SEXP _darch_rpropGradientsCpp(SEXP ggSEXP, SEXP gradientsSEXP) {
BEGIN_RCPP
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type gg(ggSEXP);
    Rcpp::traits::input_parameter< NumericMatrix >::type gradients(gradientsSEXP);
    rpropGradientsCpp(gg, gradients);
    return R_NilValue;
END_RCPP
}
// rpropDeltaCpp
void rpropDeltaCpp(NumericMatrix gg, NumericMatrix delta, double inc, double dec, double minDelta, double maxDelta);
RcppExport SEXP _darch_rpropDeltaCpp(SEXP ggSEXP, SEXP deltaSEXP, SEXP incSEXP, SEXP decSEXP, SEXP minDeltaSEXP, SEXP maxDeltaSEXP) {
BEGIN_RCPP
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type gg(ggSEXP);
    Rcpp::traits::input_parameter< NumericMatrix >::type delta(deltaSEXP);
    Rcpp::traits::input_parameter< double >::type inc(incSEXP);
    Rcpp::traits::input_parameter< double >::type dec(decSEXP);
    Rcpp::traits::input_parameter< double >::type minDelta(minDeltaSEXP);
    Rcpp::traits::input_parameter< double >::type maxDelta(maxDeltaSEXP);
    rpropDeltaCpp(gg, delta, inc, dec, minDelta, maxDelta);
    return R_NilValue;
END_RCPP
}
// rpropDeltaWiRpropPlusCpp
void rpropDeltaWiRpropPlusCpp(const NumericMatrix gg, NumericMatrix deltaW, const NumericMatrix gradients, const NumericMatrix delta, const double newE, const double oldE);
RcppExport SEXP _darch_rpropDeltaWiRpropPlusCpp(SEXP ggSEXP, SEXP deltaWSEXP, SEXP gradientsSEXP, SEXP deltaSEXP, SEXP newESEXP, SEXP oldESEXP) {
BEGIN_RCPP
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix >::type gg(ggSEXP);
    Rcpp::traits::input_parameter< NumericMatrix >::type deltaW(deltaWSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix >::type gradients(gradientsSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix >::type delta(deltaSEXP);
    Rcpp::traits::input_parameter< const double >::type newE(newESEXP);
    Rcpp::traits::input_parameter< const double >::type oldE(oldESEXP);
    rpropDeltaWiRpropPlusCpp(gg, deltaW, gradients, delta, newE, oldE);
    return R_NilValue;
END_RCPP
}
// sigmoidUnitCpp
List sigmoidUnitCpp(NumericMatrix input);
RcppExport SEXP _darch_sigmoidUnitCpp(SEXP inputSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type input(inputSEXP);
    rcpp_result_gen = Rcpp::wrap(sigmoidUnitCpp(input));
    return rcpp_result_gen;
END_RCPP
}
// softmaxUnitCpp
List softmaxUnitCpp(NumericMatrix input);
RcppExport SEXP _darch_softmaxUnitCpp(SEXP inputSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type input(inputSEXP);
    rcpp_result_gen = Rcpp::wrap(softmaxUnitCpp(input));
    return rcpp_result_gen;
END_RCPP
}
// softplusUnitCpp
List softplusUnitCpp(NumericMatrix input);
RcppExport SEXP _darch_softplusUnitCpp(SEXP inputSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type input(inputSEXP);
    rcpp_result_gen = Rcpp::wrap(softplusUnitCpp(input));
    return rcpp_result_gen;
END_RCPP
}

static const R_CallMethodDef CallEntries[] = {
    {"_darch_applyDropoutMaskCpp", (DL_FUNC) &_darch_applyDropoutMaskCpp, 2},
    {"_darch_ditherCpp", (DL_FUNC) &_darch_ditherCpp, 2},
    {"_darch_exponentialLinearUnitCpp", (DL_FUNC) &_darch_exponentialLinearUnitCpp, 2},
    {"_darch_maxoutUnitCppParallel", (DL_FUNC) &_darch_maxoutUnitCppParallel, 4},
    {"_darch_maxoutUnitCpp", (DL_FUNC) &_darch_maxoutUnitCpp, 4},
    {"_darch_maxoutWeightUpdateCpp", (DL_FUNC) &_darch_maxoutWeightUpdateCpp, 2},
    {"_darch_minimizeCpp", (DL_FUNC) &_darch_minimizeCpp, 9},
    {"_darch_normalizeWeightsCpp", (DL_FUNC) &_darch_normalizeWeightsCpp, 2},
    {"_darch_rectifiedLinearUnitCpp", (DL_FUNC) &_darch_rectifiedLinearUnitCpp, 1},
    {"_darch_rpropGradientsCpp", (DL_FUNC) &_darch_rpropGradientsCpp, 2},
    {"_darch_rpropDeltaCpp", (DL_FUNC) &_darch_rpropDeltaCpp, 6},
    {"_darch_rpropDeltaWiRpropPlusCpp", (DL_FUNC) &_darch_rpropDeltaWiRpropPlusCpp, 6},
    {"_darch_sigmoidUnitCpp", (DL_FUNC) &_darch_sigmoidUnitCpp, 1},
    {"_darch_softmaxUnitCpp", (DL_FUNC) &_darch_softmaxUnitCpp, 1},
    {"_darch_softplusUnitCpp", (DL_FUNC) &_darch_softplusUnitCpp, 1},
    {NULL, NULL, 0}
};

RcppExport void R_init_darch(DllInfo *dll) {
    R_registerRoutines(dll, NULL, CallEntries, NULL, NULL);
    R_useDynamicSymbols(dll, FALSE);
}
