void computeActOfLayer(double* yfeatMat, int dim, ActFunKind actfunc){ int i = 0; switch(actfunc){ case SIGMOID: for (i = 0;i < dim;i++){ yfeatMat[i] = computeSigmoid(yfeatMat[i]); } break; case TANH: for(i = 0; i< dim; i++){ yfeatMat[i] = computeTanh(yfeatMat[i]); } break; default: break; } }
// hlavni funkce main int main(int argc, char* argv[]) { ProgParams state; Error err = parseParams(argc, argv, &state); CHECK_ERROR(err); switch (state.progState) { case PS_HELP: printHelp(); break; case PS_WEIGHTED_ARITHMETIC_MEAN: err = computeWeightedMean(stdin, stdout, WM_ARITHMETIC); CHECK_ERROR(err); break; case PS_WEIGHTED_QUADRATIC_MEAN: err = computeWeightedMean(stdin, stdout, WM_QUADRATIC); CHECK_ERROR(err); break; case PS_HYPERBOLIC_TANGENT: err = computeTanh(stdin, stdout, sigdigToEpsylon(state.sigdig)); CHECK_ERROR(err); break; case PS_LOGARITHM: err = computeLog(stdin, stdout, state.logBase, sigdigToEpsylon(state.sigdig)); CHECK_ERROR(err); break; default: printError(E_NOT_IMPLEMENTED); return EXIT_FAILURE; } return EXIT_SUCCESS; }