File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed
Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -16,16 +16,16 @@ using namespace arma;
1616context (" Tests for optimizers" ) {
1717
1818 double abs_tol = 1e-3 ;
19+ int n_steps = 1e5 ;
1920
2021 // SGD optimizer
2122 test_that (" the SGD optimizer works correctly" ) {
2223
23- int n_steps = 100000 ;
24-
2524 // Construct optimizer tester
2625 OptimizerTester SGDTester (" sgd" , abs_tol);
2726
28- for (int i; i < n_steps; i++) {
27+ // Perform update steps
28+ for (int i = 0 ; i < n_steps; i++) {
2929 SGDTester.step_W ();
3030 SGDTester.step_b ();
3131 }
@@ -51,12 +51,11 @@ context("Tests for optimizers") {
5151 // RMSprop Loss
5252 test_that (" the RMSprop optimizer works correctly" ) {
5353
54- int n_steps = 100000 ;
55-
5654 // Construct optimizer tester
5755 OptimizerTester RMSPropTester (" rmsprop" , abs_tol);
5856
59- for (int i; i < n_steps; i++) {
57+ // Perform update steps
58+ for (int i = 0 ; i < n_steps; i++) {
6059 RMSPropTester.step_W ();
6160 RMSPropTester.step_b ();
6261 }
@@ -82,12 +81,11 @@ context("Tests for optimizers") {
8281 // Adam optimizer
8382 test_that (" the ADAM optimizer works correctly" ) {
8483
85- int n_steps = 100000 ;
86-
8784 // Construct optimizer tester
8885 OptimizerTester AdamTester (" adam" , abs_tol);
8986
90- for (int i; i < n_steps; i++) {
87+ // Perform update steps
88+ for (int i = 0 ; i < n_steps; i++) {
9189 AdamTester.step_W ();
9290 AdamTester.step_b ();
9391 }
You can’t perform that action at this time.
0 commit comments