generated from freudenreichan/info2Praktikum-NeuronalesNetz
fertige funktion?
This commit is contained in:
parent
b4cacb2f0c
commit
3b18b43fca
9
matrix.c
9
matrix.c
@ -6,14 +6,19 @@
|
|||||||
|
|
||||||
Matrix createMatrix(unsigned int rows, unsigned int cols)
|
Matrix createMatrix(unsigned int rows, unsigned int cols)
|
||||||
{
|
{
|
||||||
|
Matrix m;
|
||||||
|
m.rows = rows;
|
||||||
|
m.cols = cols;
|
||||||
|
m.buffer = malloc(rows * cols * sizeof(MatrixType));
|
||||||
|
return m;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void clearMatrix(Matrix *matrix)
|
void clearMatrix(Matrix *m)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void setMatrixAt(MatrixType value, Matrix matrix, unsigned int rowIdx, unsigned int colIdx)
|
void setMatrixAt(MatrixType value, Matrix matrix, unsigned int rowIdx, unsigned int colIdx)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@ -240,7 +240,8 @@ void test_predictReturnsCorrectLabels(void)
|
|||||||
MatrixType weightsBuffer2[] = {-9, 10, 11, 12, 13, 14};
|
MatrixType weightsBuffer2[] = {-9, 10, 11, 12, 13, 14};
|
||||||
MatrixType weightsBuffer3[] = {-15, 16, 17, 18, -19, 20, 21, 22, 23, -24, 25, 26, 27, -28, -29};
|
MatrixType weightsBuffer3[] = {-15, 16, 17, 18, -19, 20, 21, 22, 23, -24, 25, 26, 27, -28, -29};
|
||||||
Matrix weights1 = {.buffer=weightsBuffer1, .rows=2, .cols=4};
|
Matrix weights1 = {.buffer=weightsBuffer1, .rows=2, .cols=4};
|
||||||
Matrix weights2 = {.buffer=weightsBuffer2, .rows=3, .cols=2};
|
|
||||||
|
Matrix weights2 = {.buffer=weightsBuffer2, .rows=3, .cols=2};
|
||||||
Matrix weights3 = {.buffer=weightsBuffer3, .rows=5, .cols=3};
|
Matrix weights3 = {.buffer=weightsBuffer3, .rows=5, .cols=3};
|
||||||
MatrixType biasBuffer1[] = {200, 0};
|
MatrixType biasBuffer1[] = {200, 0};
|
||||||
MatrixType biasBuffer2[] = {0, -100, 0};
|
MatrixType biasBuffer2[] = {0, -100, 0};
|
||||||
@ -258,7 +259,6 @@ void test_predictReturnsCorrectLabels(void)
|
|||||||
TEST_ASSERT_EQUAL_UINT8_ARRAY(expectedLabels, predictedLabels, n);
|
TEST_ASSERT_EQUAL_UINT8_ARRAY(expectedLabels, predictedLabels, n);
|
||||||
free(predictedLabels);
|
free(predictedLabels);
|
||||||
}
|
}
|
||||||
|
|
||||||
void setUp(void) {
|
void setUp(void) {
|
||||||
// Falls notwendig, kann hier Vorbereitungsarbeit gemacht werden
|
// Falls notwendig, kann hier Vorbereitungsarbeit gemacht werden
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user