Add VGG16 architecture with 227x227 image input

This commit is contained in:
julienChemillier 2023-05-19 17:28:07 +02:00
parent 4fcfba5b33
commit a4b42445c1
2 changed files with 38 additions and 0 deletions

View File

@ -22,6 +22,13 @@ Network* create_network_alexnet(float learning_rate, int dropout, int activation
*/
Network* create_network_VGG16(float learning_rate, int dropout, int activation, int initialisation, int size_output);
/*
* Renvoie un réseau suivant l'architecture VGG16 originel pour prendre en entrée 3x227x227
* et une sortie de taille 1 000
*/
Network* create_network_VGG16_227(float learning_rate, int dropout, int activation, int initialisation);
/*
* Renvoie un réseau sans convolution, similaire à celui utilisé dans src/dense
*/

View File

@ -66,6 +66,37 @@ Network* create_network_VGG16(float learning_rate, int dropout, int activation,
return network;
}
Network* create_network_VGG16_227(float learning_rate, int dropout, int activation, int initialisation) {
Network* network = create_network(22, learning_rate, dropout, initialisation, 227, 3);
add_convolution(network, 3, 64, 1, 1, activation); // Conv3-64
add_convolution(network, 3, 64, 1, 1, activation); // Conv3-64
add_average_pooling(network, 2, 2, 0); // Max Pool
add_convolution(network, 3, 128, 1, 1, activation); // Conv3-128
add_convolution(network, 1, 128, 1, 0, activation); // Conv1-128
add_average_pooling(network, 2, 2, 0); // Max Pool
add_convolution(network, 3, 256, 1, 1, activation); // Conv3-256
add_convolution(network, 3, 256, 1, 1, activation); // Conv3-256
add_convolution(network, 1, 256, 1, 0, activation); // Conv1-256
add_average_pooling(network, 2, 2, 0); // Max Pool
add_convolution(network, 3, 512, 1, 1, activation); // Conv3-512
add_convolution(network, 3, 512, 1, 1, activation); // Conv3-512
add_convolution(network, 1, 512, 1, 0, activation); // Conv1-512
add_average_pooling(network, 2, 2, 0); // Max Pool
add_convolution(network, 3, 512, 1, 1, activation); // Conv3-512
add_convolution(network, 3, 512, 1, 1, activation); // Conv3-512
add_convolution(network, 1, 512, 1, 0, activation); // Conv1-512
add_average_pooling(network, 2, 2, 0); // Max Pool
add_dense_linearisation(network, 4096, activation);
add_dense(network, 4096, activation);
add_dense(network, 1000, SOFTMAX);
return network;
}
Network* create_simple_one(float learning_rate, int dropout, int activation, int initialisation, int input_width, int input_depth) {
Network* network = create_network(3, learning_rate, dropout, initialisation, input_width, input_depth);
add_dense_linearisation(network, 80, activation);