2#include "ae2f/errGlob.h"
3#include <ae2f/Ann/Slp.h>
9 *r = 1.0 / (1.0 + exp(-x));
15 *r = output * (1.0 - output);
24 o_i = o_i < epsilon ? epsilon : (o_i > 1.0 - epsilon ? 1.0 - epsilon : o_i);
25 *r = (o_i - target[i]) / (c * o_i * (1.0 - o_i));
41#define DIFF_GOOD(a, b) (((a) - (b)) * ((a) - (b))) < THRESHOLD
44 puts(
"Trial: tryand");
53 , Act, ActDeriv, LossDeriv
58 printf(
"Learningrate dump: %f, %f\n",
slp->m_learningrate,
slp->m_learningrate_bias);
59 printf(
"function points: %p %p %p\n",
slp->m_act,
slp->m_actderiv,
slp->m_lossderiv);
63 for(
i = 0 ;
i < 2 * 1 + 1; ++
i) {
64 slp->m_weight[
i] = 0.2;
68 for(
i = 0;
i < 1000; ++
i) {
69 for(
j = 0;
j <
sizeof(
inp) /
sizeof(
inp[0]); ++
j) {
75 for(
j = 0;
j <
sizeof(
inp) /
sizeof(
inp[0]); ++
j) {
79 printf(
"Got %f\n", *
output);
81 printf(
"Match. Expected %f\n.",
goal_and[
j]);
83 printf(
"Expected %f. Unexpected.\n",
goal_and[
j]);
94 else puts(
"slp is null");
95 printf(
"Code from tryand: %d\n",
err);
const ae2f_float_t goal_or[4]
const ae2f_float_t goal_and[4]
const ae2f_float_t inp[4][2]
#define ae2f_errGlob_NFOUND
Found some errors, but not by parameters. The operation has failed.
uint8_t ae2f_err_t
Informs that this number represents the error.