1#define ae2f_MAC_BUILD OFF
3#include "ae2f/Float.auto.h"
5#include <ae2f/Ann/Mlp.h>
10 *r = 1.0 / (1.0 + exp(-x));
14 *r = output * (1.0 - output);
18 *r = ((output[i] - target[i]) / c);
33size_t
lenv[] = {2, 3, 3, 1};
47 assert(
mlp->m_learningrate != 0);
48 assert(
mlp->m_learningrate_bias != 0);
50 for(
i = 0;
i < 3;
i++) {
52 mlp->m_actderiv[
i] = ActDeriv;
53 for(
j = 0;
j < 9;
j++) {
54 mlp->m_weight[
j +
i * 9] = ((
double)rand() / RAND_MAX) - 0.5;
57 for(
j = 0;
j < 3;
j++) {
58 mlp->m_bias[
j] = ((
double)rand() / RAND_MAX) - 0.5;
63 printf(
"[Error]: %d\n",
err[0]);
64 assert(0 &&
"errval has occurred.");
67 for(
j = 0;
j < 4;
j++) {
69 assert(!
err[0] &&
"err from predict");
73 for(
i = 0;
i < 99000;
i++) {
74 for(
j = 0;
j < 4;
j++) {
79 assert(!
err[0] &&
"err from TrainAutoStream");
83 for(
j = 0;
j < 4;
j++) {
85 assert(!
err[0] &&
"err from predict");
#define ae2f_float
Predefined floating point type.
const ae2f_float_t goal_xor[4]
const ae2f_float_t inp[4][2]
uint8_t ae2f_err_t
Informs that this number represents the error.
#define ae2f_AnnMlpTrainAutoStream
#define ae2f_AnnMlpPredict