Next up is dropout layers
This commit is contained in:
@@ -706,9 +706,16 @@ int main(void) {
|
||||
panic::tensor::real_matrix X;
|
||||
panic::tensor::uint_vector y;
|
||||
|
||||
panic::types::uint_t samples = 100;
|
||||
panic::types::uint_t samples = 1000;
|
||||
panic::types::uint_t classes = 3;
|
||||
|
||||
panic::types::uint_t layer_size = 256;
|
||||
|
||||
|
||||
panic::types::real_t weight_regularizer_l1 = 0;
|
||||
panic::types::real_t weight_regularizer_l2 = 5e-4;
|
||||
panic::types::real_t bias_regularizer_l1 = 0;
|
||||
panic::types::real_t bias_regularizer_l2 = 5e-4;
|
||||
|
||||
// create spiral data
|
||||
panic::neural_network::spiral_data(samples, classes, X, y);
|
||||
@@ -718,7 +725,11 @@ int main(void) {
|
||||
panic::neural_network::model mymodel;
|
||||
|
||||
// Create Dense layer with 2 input features and 3 output values
|
||||
if (!mymodel.add_layer_dense(2,64)){
|
||||
if (!mymodel.add_layer_dense(2,layer_size,
|
||||
weight_regularizer_l1,
|
||||
weight_regularizer_l2,
|
||||
bias_regularizer_l1,
|
||||
bias_regularizer_l2)){
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -726,9 +737,14 @@ int main(void) {
|
||||
if (!mymodel.add_activation_relu()){
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// Create a second dense layer with 3 inputs and 3 outputs
|
||||
if (!mymodel.add_layer_dense(64, 3)){
|
||||
if (!mymodel.add_layer_dense(layer_size, 3,
|
||||
weight_regularizer_l1,
|
||||
weight_regularizer_l2,
|
||||
bias_regularizer_l1,
|
||||
bias_regularizer_l2)){
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -769,7 +785,7 @@ int main(void) {
|
||||
}
|
||||
*/
|
||||
|
||||
panic::types::real_t learning_rate = 0.02;
|
||||
panic::types::real_t learning_rate = 0.001;
|
||||
panic::types::real_t decay = 1e-5;
|
||||
panic::types::real_t epsilon = 1e-7;
|
||||
panic::types::real_t beta_1 = 0.9;
|
||||
@@ -794,5 +810,11 @@ int main(void) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user