HolyFuckItsAlive #13
1 changed files with 10 additions and 0 deletions
|
|
@ -170,6 +170,12 @@ Matrix* predict(Neural_Network* network, Matrix* image_data) {
|
|||
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 batch_train_network(Neural_Network* network, Image** images, int size);
|
||||
|
||||
|
|
@ -180,6 +186,10 @@ double relu(double input) {
|
|||
return input;
|
||||
}
|
||||
|
||||
double relu_derivative(double x) {
|
||||
return (x > 0) ? 1 : 0;
|
||||
}
|
||||
|
||||
Matrix* softmax(Matrix* matrix) {
|
||||
double total = 0;
|
||||
|
||||
|
|
|
|||
Reference in a new issue