minor changes
This commit is contained in:
parent
3349ce7a43
commit
ab97604bda
2 changed files with 12 additions and 6 deletions
5
main.c
5
main.c
|
|
@ -5,9 +5,9 @@
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
Image** images = import_images("../data/train-images.idx3-ubyte", "../data/train-labels.idx1-ubyte", NULL, 60000);
|
Image** images = import_images("../data/train-images.idx3-ubyte", "../data/train-labels.idx1-ubyte", NULL, 60000);
|
||||||
// img_visualize(images[4]);
|
// img_visualize(images[0]);
|
||||||
|
|
||||||
Neural_Network* nn = new_network(28*28, 50, 10, 0.1);
|
Neural_Network* nn = new_network(28*28, 50, 10, 0.01);
|
||||||
randomize_network(nn, 1);
|
randomize_network(nn, 1);
|
||||||
// save_network(nn);
|
// save_network(nn);
|
||||||
|
|
||||||
|
|
@ -16,6 +16,7 @@ int main() {
|
||||||
|
|
||||||
for (int i = 0; i < 20000; ++i) {
|
for (int i = 0; i < 20000; ++i) {
|
||||||
train_network(nn, images[i], images[i]->label);
|
train_network(nn, images[i], images[i]->label);
|
||||||
|
// matrix_print(nn->weights_output);
|
||||||
}
|
}
|
||||||
|
|
||||||
// train_network(nn, images[0], images[0]->label);
|
// train_network(nn, images[0], images[0]->label);
|
||||||
|
|
|
||||||
|
|
@ -33,10 +33,15 @@ void randomize_network(Neural_Network* network, int scope){
|
||||||
matrix_randomize(network->weights_2, scope);
|
matrix_randomize(network->weights_2, scope);
|
||||||
matrix_randomize(network->weights_3, scope);
|
matrix_randomize(network->weights_3, scope);
|
||||||
matrix_randomize(network->weights_output, scope);
|
matrix_randomize(network->weights_output, scope);
|
||||||
matrix_randomize(network->bias_1, scope);
|
// matrix_randomize(network->bias_1, scope);
|
||||||
matrix_randomize(network->bias_2, scope);
|
// matrix_randomize(network->bias_2, scope);
|
||||||
matrix_randomize(network->bias_3, scope);
|
// matrix_randomize(network->bias_3, scope);
|
||||||
matrix_randomize(network->bias_output, scope);
|
// matrix_randomize(network->bias_output, scope);
|
||||||
|
|
||||||
|
matrix_fill(network->bias_1, 1);
|
||||||
|
matrix_fill(network->bias_2, 1);
|
||||||
|
matrix_fill(network->bias_3, 1);
|
||||||
|
matrix_fill(network->bias_output, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void free_network(Neural_Network* network){
|
void free_network(Neural_Network* network){
|
||||||
|
|
|
||||||
Reference in a new issue