Exemple #1
0
    def testRmspropmomentumVectorPolynomialDecaySchedule(self):
        def loss(x):
            return np.dot(x, x)

        x0 = np.ones(2)
        step_schedule = optimizers.polynomial_decay(1.0, 50, 0.1)
        self._CheckFuns(optimizers.rmsprop_momentum, loss, x0, step_schedule)
Exemple #2
0
def build_opt(lr, params):
    lr = optimizers.polynomial_decay(lr, 15000, lr * 1e-7, 2.0)

    (opt_init, opt_update, opt_get_params) = optimizers.adam(lr)
    opt_state = opt_init(params)
    return (opt_state, opt_update, opt_get_params)