warum hab i ka highlighting mehr
This commit is contained in:
parent
f18a7714a2
commit
a6823bbeeb
1 changed files with 10 additions and 0 deletions
|
|
@ -170,6 +170,12 @@ Matrix* predict(Neural_Network* network, Matrix* image_data) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
double cost_function(Matrix* calculated, int expected){
|
||||||
|
calculated->numbers[expected] -= 1;
|
||||||
|
apply(square, calculated);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//void train_network(Neural_Network* network, Matrix* input, Matrix* output);
|
//void train_network(Neural_Network* network, Matrix* input, Matrix* output);
|
||||||
//void batch_train_network(Neural_Network* network, Image** images, int size);
|
//void batch_train_network(Neural_Network* network, Image** images, int size);
|
||||||
|
|
||||||
|
|
@ -180,6 +186,10 @@ double relu(double input) {
|
||||||
return input;
|
return input;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
double relu_derivative(double x) {
|
||||||
|
return (x > 0) ? 1 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
Matrix* softmax(Matrix* matrix) {
|
Matrix* softmax(Matrix* matrix) {
|
||||||
double total = 0;
|
double total = 0;
|
||||||
|
|
||||||
|
|
|
||||||
Reference in a new issue