summaryrefslogtreecommitdiff
path: root/matrix.c
diff options
context:
space:
mode:
authorSoikk2022-08-29 21:05:49 +0200
committerSoikk2022-08-29 21:05:49 +0200
commit33f4cdb84a2b1dcb494d8adbc13d6eb0cc475740 (patch)
treedf954289978eb0e0af7e822bafd65f8c04a8641d /matrix.c
parent2d044eaa3691fa24fb503af433b13a4c269aaab2 (diff)
downloadsoikk-matrix-33f4cdb84a2b1dcb494d8adbc13d6eb0cc475740.tar.xz
soikk-matrix-33f4cdb84a2b1dcb494d8adbc13d6eb0cc475740.tar.zst
Corrected an error and updated main
Diffstat (limited to 'matrix.c')
-rw-r--r--matrix.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/matrix.c b/matrix.c
index 14b7940..e10b467 100644
--- a/matrix.c
+++ b/matrix.c
@@ -239,6 +239,21 @@ matrix *raiseMatrix(matrix *m, int n){
matrix *final_inputs = multiplyMatrices(output_weights, hidden_inputs);
printf("done\n");
+
+ matrix *in = newMatrix(1, 2); in->data[0][0] = 0; in->data[0][1] = 1;
+ matrix *layer = newMatrix(1, 2); layer->data[0][0] = 0.188; layer->data[0][1] = 0.812;
+ matrix *layerm = newMatrix(1, 2); layerm->data[0][0] = 0.812; layerm->data[0][1] = 0.188;
+
+ matrix *diff = subtractMatrices(in, layer);
+ matrix *der = HadamardProduct(layer, layerm);
+ matrix *res = HadamardProduct(diff, der);
+
+ for(int i = 0; i < res->rows; ++i){
+ for(int j = 0; j < res->cols; ++j){
+ printf("%.3Lf\t", res->data[i][j]);
+ }
+ printf("\n");
+ }
return 0;
}*/