[optimization] Stochastic gradient descent with gain schedule a la Leon Bottou

This commit is contained in:
Al
2016-01-08 00:54:17 -05:00
parent 6b164d263e
commit 8b70529711
2 changed files with 47 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
/*
Stochastic gradient descent implementation
Based on Leon Bottou's Stochastic Gradient Descent Tricks:
http://leon.bottou.org/publications/pdf/tricks-2012.pdf
Learning rate calculated as:
gamma_t = gamma_0(1 + gamma_0 * lambda * t)^-1
*/
#ifndef STOCHASTIC_GRADIENT_DESCENT_H
#define STOCHASTIC_GRADIENT_DESCENT_H
#include <stdlib.h>
#include <stdbool.h>
#include "matrix.h"
bool stochastic_gradient_descent(matrix_t *theta, matrix_t *gradient, double alpha);
bool stochastic_gradient_descent_scheduled(matrix_t *theta, matrix_t *gradient, float lambda, uint32_t t, double gamma_0);
#endif