|
32 | 32 | },
|
33 | 33 | {
|
34 | 34 | "cell_type": "code",
|
35 |
| - "execution_count": 2, |
| 35 | + "execution_count": 1, |
36 | 36 | "metadata": {
|
37 | 37 | "collapsed": true
|
38 | 38 | },
|
|
54 | 54 | },
|
55 | 55 | {
|
56 | 56 | "cell_type": "code",
|
57 |
| - "execution_count": 3, |
| 57 | + "execution_count": 2, |
58 | 58 | "metadata": {
|
59 | 59 | "collapsed": false
|
60 | 60 | },
|
|
77 | 77 | },
|
78 | 78 | {
|
79 | 79 | "cell_type": "code",
|
80 |
| - "execution_count": 4, |
| 80 | + "execution_count": 3, |
81 | 81 | "metadata": {
|
82 | 82 | "collapsed": false
|
83 | 83 | },
|
|
113 | 113 | },
|
114 | 114 | {
|
115 | 115 | "cell_type": "code",
|
116 |
| - "execution_count": 5, |
| 116 | + "execution_count": 4, |
117 | 117 | "metadata": {
|
118 | 118 | "collapsed": false
|
119 | 119 | },
|
|
133 | 133 | },
|
134 | 134 | {
|
135 | 135 | "cell_type": "code",
|
136 |
| - "execution_count": 6, |
| 136 | + "execution_count": 5, |
137 | 137 | "metadata": {
|
138 | 138 | "collapsed": true
|
139 | 139 | },
|
|
153 | 153 | },
|
154 | 154 | {
|
155 | 155 | "cell_type": "code",
|
156 |
| - "execution_count": 7, |
| 156 | + "execution_count": 6, |
157 | 157 | "metadata": {
|
158 | 158 | "collapsed": true
|
159 | 159 | },
|
|
164 | 164 | ]
|
165 | 165 | },
|
166 | 166 | {
|
167 |
| - "cell_type": "code", |
168 |
| - "execution_count": 8, |
169 |
| - "metadata": { |
170 |
| - "collapsed": false |
171 |
| - }, |
172 |
| - "outputs": [ |
173 |
| - { |
174 |
| - "data": { |
175 |
| - "text/plain": [ |
176 |
| - "[('iter', 10000),\n", |
177 |
| - " ('net', <caffe._caffe.Net at 0x1f9d488>),\n", |
178 |
| - " ('restore',\n", |
179 |
| - " <bound method SGDSolver.restore of <caffe._caffe.SGDSolver object at 0x1fb19f0>>),\n", |
180 |
| - " ('set_iter',\n", |
181 |
| - " <bound method SGDSolver.set_iter of <caffe._caffe.SGDSolver object at 0x1fb19f0>>),\n", |
182 |
| - " ('snapshot',\n", |
183 |
| - " <bound method SGDSolver.snapshot of <caffe._caffe.SGDSolver object at 0x1fb19f0>>),\n", |
184 |
| - " ('solve',\n", |
185 |
| - " <bound method SGDSolver.solve of <caffe._caffe.SGDSolver object at 0x1fb19f0>>),\n", |
186 |
| - " ('step',\n", |
187 |
| - " <bound method SGDSolver.step of <caffe._caffe.SGDSolver object at 0x1fb19f0>>),\n", |
188 |
| - " ('test_nets', <caffe._caffe.NetVec at 0x49f4de0>)]" |
189 |
| - ] |
190 |
| - }, |
191 |
| - "execution_count": 8, |
192 |
| - "metadata": {}, |
193 |
| - "output_type": "execute_result" |
194 |
| - } |
195 |
| - ], |
| 167 | + "cell_type": "markdown", |
| 168 | + "metadata": {}, |
196 | 169 | "source": [
|
197 |
| - "[(e, getattr(solver, e)) for e in dir(solver) if not e.startswith(\"__\")]" |
| 170 | + "And there you go! This is the Python equivalent of\n", |
| 171 | + "`example/mnist/train_lenet.sh`, or\n", |
| 172 | + "\n", |
| 173 | + "`$ caffe train --solver=examples/mnist/lenet_solver.prototxt`" |
198 | 174 | ]
|
199 | 175 | },
|
200 | 176 | {
|
201 | 177 | "cell_type": "markdown",
|
202 | 178 | "metadata": {},
|
203 | 179 | "source": [
|
204 |
| - "And there you go! This is the Python equivalent of\n", |
205 |
| - "`example/mnist/train_lenet.sh`, or\n", |
206 |
| - "\n", |
207 |
| - "`$ caffe train --solver=examples/mnist/lenet_solver.prototxt`\n", |
| 180 | + "You can always consult at which iteration a solver is, with `solver.iter`. You can take a snapshot of the solver with `solver.snapshot(file)`, and load it with `solver.restort(file)`. You can choose to move step-by-step with `solver.step(step_num)`.\n", |
208 | 181 | "\n",
|
209 |
| - "But you can do much more than that with python. The next part covers network manipulation." |
| 182 | + "The underlying nets can be accessed with `solver.net` for the training net, and `solver.test_nets` for the testing nets." |
| 183 | + ] |
| 184 | + }, |
| 185 | + { |
| 186 | + "cell_type": "markdown", |
| 187 | + "metadata": {}, |
| 188 | + "source": [ |
| 189 | + "But you can do much more than that with python, you don't have to use a pre-made solver limiting your possibilities. The next part covers network manipulation." |
210 | 190 | ]
|
211 | 191 | }
|
212 | 192 | ],
|
|
0 commit comments