Skip to content

Commit 9563537

Browse files
committed
Update examples and docs
1 parent c1f7fe1 commit 9563537

7 files changed

+20
-20
lines changed

docs/tutorial/solver.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ The responsibilities of learning are divided between the Solver for overseeing t
88

99
The Caffe solvers are:
1010

11-
- Stochastic Gradient Descent (`SGD`),
12-
- AdaDelta (`ADADELTA`),
13-
- Adaptive Gradient (`ADAGRAD`),
14-
- Adam (`ADAM`),
15-
- Nesterov's Accelerated Gradient (`NESTEROV`) and
16-
- RMSprop (`RMSPROP`)
11+
- Stochastic Gradient Descent (`type: "SGD"`),
12+
- AdaDelta (`type: "AdaDelta"`),
13+
- Adaptive Gradient (`type: "AdaGrad"`),
14+
- Adam (`type: "Adam"`),
15+
- Nesterov's Accelerated Gradient (`type: "Nesterov"`) and
16+
- RMSprop (`type: "RMSProp"`)
1717

1818
The solver
1919

@@ -51,7 +51,7 @@ The parameter update $$\Delta W$$ is formed by the solver from the error gradien
5151

5252
### SGD
5353

54-
**Stochastic gradient descent** (`solver_type: SGD`) updates the weights $$ W $$ by a linear combination of the negative gradient $$ \nabla L(W) $$ and the previous weight update $$ V_t $$.
54+
**Stochastic gradient descent** (`type: "SGD"`) updates the weights $$ W $$ by a linear combination of the negative gradient $$ \nabla L(W) $$ and the previous weight update $$ V_t $$.
5555
The **learning rate** $$ \alpha $$ is the weight of the negative gradient.
5656
The **momentum** $$ \mu $$ is the weight of the previous update.
5757

@@ -113,7 +113,7 @@ If learning diverges (e.g., you start to see very large or `NaN` or `inf` loss v
113113

114114
### AdaDelta
115115

116-
The **AdaDelta** (`solver_type: ADADELTA`) method (M. Zeiler [1]) is a "robust learning rate method". It is a gradient-based optimization method (like SGD). The update formulas are
116+
The **AdaDelta** (`type: "AdaDelta"`) method (M. Zeiler [1]) is a "robust learning rate method". It is a gradient-based optimization method (like SGD). The update formulas are
117117

118118
$$
119119
\begin{align}
@@ -125,7 +125,7 @@ E[g^2]_t &= \delta{E[g^2]_{t-1} } + (1-\delta)g_{t}^2
125125
\end{align}
126126
$$
127127

128-
and
128+
and
129129

130130
$$
131131
(W_{t+1})_i =
@@ -139,7 +139,7 @@ $$
139139

140140
### AdaGrad
141141

142-
The **adaptive gradient** (`solver_type: ADAGRAD`) method (Duchi et al. [1]) is a gradient-based optimization method (like SGD) that attempts to "find needles in haystacks in the form of very predictive but rarely seen features," in Duchi et al.'s words.
142+
The **adaptive gradient** (`type: "AdaGrad"`) method (Duchi et al. [1]) is a gradient-based optimization method (like SGD) that attempts to "find needles in haystacks in the form of very predictive but rarely seen features," in Duchi et al.'s words.
143143
Given the update information from all previous iterations $$ \left( \nabla L(W) \right)_{t'} $$ for $$ t' \in \{1, 2, ..., t\} $$,
144144
the update formulas proposed by [1] are as follows, specified for each component $$i$$ of the weights $$W$$:
145145

@@ -159,7 +159,7 @@ Note that in practice, for weights $$ W \in \mathcal{R}^d $$, AdaGrad implementa
159159

160160
### Adam
161161

162-
The **Adam** (`solver_type: ADAM`), proposed in Kingma et al. [1], is a gradient-based optimization method (like SGD). This includes an "adaptive moment estimation" ($$m_t, v_t$$) and can be regarded as a generalization of AdaGrad. The update formulas are
162+
The **Adam** (`type: "Adam"`), proposed in Kingma et al. [1], is a gradient-based optimization method (like SGD). This includes an "adaptive moment estimation" ($$m_t, v_t$$) and can be regarded as a generalization of AdaGrad. The update formulas are
163163

164164
$$
165165
(m_t)_i = \beta_1 (m_{t-1})_i + (1-\beta_1)(\nabla L(W_t))_i,\\
@@ -181,7 +181,7 @@ Kingma et al. [1] proposed to use $$\beta_1 = 0.9, \beta_2 = 0.999, \varepsilon
181181

182182
### NAG
183183

184-
**Nesterov's accelerated gradient** (`solver_type: NESTEROV`) was proposed by Nesterov [1] as an "optimal" method of convex optimization, achieving a convergence rate of $$ \mathcal{O}(1/t^2) $$ rather than the $$ \mathcal{O}(1/t) $$.
184+
**Nesterov's accelerated gradient** (`type: "Nesterov"`) was proposed by Nesterov [1] as an "optimal" method of convex optimization, achieving a convergence rate of $$ \mathcal{O}(1/t^2) $$ rather than the $$ \mathcal{O}(1/t) $$.
185185
Though the required assumptions to achieve the $$ \mathcal{O}(1/t^2) $$ convergence typically will not hold for deep networks trained with Caffe (e.g., due to non-smoothness and non-convexity), in practice NAG can be a very effective method for optimizing certain types of deep learning architectures, as demonstrated for deep MNIST autoencoders by Sutskever et al. [2].
186186

187187
The weight update formulas look very similar to the SGD updates given above:
@@ -206,10 +206,10 @@ What distinguishes the method from SGD is the weight setting $$ W $$ on which we
206206

207207
### RMSprop
208208

209-
The **RMSprop** (`solver_type: RMSPROP`), suggested by Tieleman in a Coursera course lecture, is a gradient-based optimization method (like SGD). The update formulas are
209+
The **RMSprop** (`type: "RMSProp"`), suggested by Tieleman in a Coursera course lecture, is a gradient-based optimization method (like SGD). The update formulas are
210210

211211
$$
212-
(v_t)_i =
212+
(v_t)_i =
213213
\begin{cases}
214214
(v_{t-1})_i + \delta, &(\nabla L(W_t))_i(\nabla L(W_{t-1}))_i > 0\\
215215
(v_{t-1})_i \cdot (1-\delta), & \text{else}

examples/mnist/lenet_adadelta_solver.prototxt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ snapshot: 5000
2020
snapshot_prefix: "examples/mnist/lenet_adadelta"
2121
# solver mode: CPU or GPU
2222
solver_mode: GPU
23-
solver_type: ADADELTA
23+
type: "AdaDelta"
2424
delta: 1e-6

examples/mnist/lenet_solver_adam.prototxt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ max_iter: 10000
2222
snapshot: 5000
2323
snapshot_prefix: "examples/mnist/lenet"
2424
# solver mode: CPU or GPU
25-
solver_type: ADAM
25+
type: "Adam"
2626
solver_mode: GPU

examples/mnist/lenet_solver_rmsprop.prototxt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ snapshot: 5000
2323
snapshot_prefix: "examples/mnist/lenet_rmsprop"
2424
# solver mode: CPU or GPU
2525
solver_mode: GPU
26-
solver_type: RMSPROP
26+
type: "RMSProp"
2727
rms_decay: 0.98

examples/mnist/mnist_autoencoder_solver_adadelta.prototxt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ snapshot: 10000
1616
snapshot_prefix: "examples/mnist/mnist_autoencoder_adadelta_train"
1717
# solver mode: CPU or GPU
1818
solver_mode: GPU
19-
solver_type: ADADELTA
19+
type: "AdaDelta"

examples/mnist/mnist_autoencoder_solver_adagrad.prototxt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ snapshot: 10000
1414
snapshot_prefix: "examples/mnist/mnist_autoencoder_adagrad_train"
1515
# solver mode: CPU or GPU
1616
solver_mode: GPU
17-
solver_type: ADAGRAD
17+
type: "AdaGrad"

examples/mnist/mnist_autoencoder_solver_nesterov.prototxt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ snapshot_prefix: "examples/mnist/mnist_autoencoder_nesterov_train"
1717
momentum: 0.95
1818
# solver mode: CPU or GPU
1919
solver_mode: GPU
20-
solver_type: NESTEROV
20+
type: "Nesterov"

0 commit comments

Comments
 (0)