def test_vanilla(self):
     model_descent = single_run_descent(linear_X, linear_Y, FL_VanillaSGD,
                                        self.linear_params)
     self.assertLess(np.log10(model_descent.losses[-1] - self.linear_obj),
                     -3)
     model_descent = single_run_descent(logistic_X, logistic_Y,
                                        FL_VanillaSGD, self.logistic_params)
     self.assertLess(np.log10(model_descent.losses[-1] - self.logistic_obj),
                     -3.5)
 def test_bi_qsgd(self):
     model_descent = single_run_descent(linear_X, linear_Y, ArtemisDescent,
                                        self.linear_params)
     self.assertLess(np.log10(model_descent.losses[-1] - self.linear_obj),
                     -2)
     model_descent = single_run_descent(logistic_X, logistic_Y,
                                        ArtemisDescent,
                                        self.logistic_params)
     self.assertLess(np.log10(model_descent.losses[-1] - self.logistic_obj),
                     -3.5)
Beispiel #3
0
 def test_artemis(self):
     model_descent = single_run_descent(self.linear_cost_models, ArtemisDescent, self.linear_params)
     self.assertLess(np.log10(model_descent.train_losses[-1] - self.linear_obj), -2)
     model_descent = single_run_descent(self.logistic_cost_models, ArtemisDescent, self.logistic_params)
     self.assertLess(np.log10(model_descent.train_losses[-1] - self.logistic_obj), -3.5)
Beispiel #4
0
 def test_vanilla(self):
     model_descent = single_run_descent(self.linear_cost_models, SGD_Descent, self.linear_params)
     self.assertLess(np.log10(model_descent.train_losses[-1] - self.linear_obj), -3)
     model_descent = single_run_descent(self.logistic_cost_models, SGD_Descent, self.logistic_params)
     self.assertLess(np.log10(model_descent.train_losses[-1] - self.logistic_obj), -3.5)