Skip to content

Commit 53b6ecf

Browse files
committed
Re-run, set the random seeds for reproducible results
1 parent 3187592 commit 53b6ecf

File tree

4 files changed

+139
-146
lines changed

4 files changed

+139
-146
lines changed

00 Basic solver usage.ipynb

Lines changed: 21 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
},
3333
{
3434
"cell_type": "code",
35-
"execution_count": 2,
35+
"execution_count": 1,
3636
"metadata": {
3737
"collapsed": true
3838
},
@@ -54,7 +54,7 @@
5454
},
5555
{
5656
"cell_type": "code",
57-
"execution_count": 3,
57+
"execution_count": 2,
5858
"metadata": {
5959
"collapsed": false
6060
},
@@ -77,7 +77,7 @@
7777
},
7878
{
7979
"cell_type": "code",
80-
"execution_count": 4,
80+
"execution_count": 3,
8181
"metadata": {
8282
"collapsed": false
8383
},
@@ -113,7 +113,7 @@
113113
},
114114
{
115115
"cell_type": "code",
116-
"execution_count": 5,
116+
"execution_count": 4,
117117
"metadata": {
118118
"collapsed": false
119119
},
@@ -133,7 +133,7 @@
133133
},
134134
{
135135
"cell_type": "code",
136-
"execution_count": 6,
136+
"execution_count": 5,
137137
"metadata": {
138138
"collapsed": true
139139
},
@@ -153,7 +153,7 @@
153153
},
154154
{
155155
"cell_type": "code",
156-
"execution_count": 7,
156+
"execution_count": 6,
157157
"metadata": {
158158
"collapsed": true
159159
},
@@ -164,49 +164,29 @@
164164
]
165165
},
166166
{
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": {},
196169
"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`"
198174
]
199175
},
200176
{
201177
"cell_type": "markdown",
202178
"metadata": {},
203179
"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",
208181
"\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."
210190
]
211191
}
212192
],

01 Loading a network.ipynb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
{
1313
"cell_type": "code",
14-
"execution_count": 15,
14+
"execution_count": 1,
1515
"metadata": {
1616
"collapsed": true
1717
},
@@ -144,7 +144,7 @@
144144
},
145145
{
146146
"cell_type": "code",
147-
"execution_count": 6,
147+
"execution_count": 5,
148148
"metadata": {
149149
"collapsed": true
150150
},
@@ -188,7 +188,7 @@
188188
},
189189
{
190190
"cell_type": "code",
191-
"execution_count": 7,
191+
"execution_count": 6,
192192
"metadata": {
193193
"collapsed": true
194194
},
@@ -227,7 +227,7 @@
227227
},
228228
{
229229
"cell_type": "code",
230-
"execution_count": 8,
230+
"execution_count": 7,
231231
"metadata": {
232232
"collapsed": false
233233
},
@@ -259,7 +259,7 @@
259259
},
260260
{
261261
"cell_type": "code",
262-
"execution_count": 9,
262+
"execution_count": 8,
263263
"metadata": {
264264
"collapsed": true
265265
},
@@ -277,7 +277,7 @@
277277
},
278278
{
279279
"cell_type": "code",
280-
"execution_count": 11,
280+
"execution_count": 9,
281281
"metadata": {
282282
"collapsed": false
283283
},
@@ -350,7 +350,7 @@
350350
},
351351
{
352352
"cell_type": "code",
353-
"execution_count": 12,
353+
"execution_count": 10,
354354
"metadata": {
355355
"collapsed": true
356356
},
@@ -368,7 +368,7 @@
368368
},
369369
{
370370
"cell_type": "code",
371-
"execution_count": 13,
371+
"execution_count": 11,
372372
"metadata": {
373373
"collapsed": true
374374
},
@@ -388,7 +388,7 @@
388388
},
389389
{
390390
"cell_type": "code",
391-
"execution_count": 14,
391+
"execution_count": 12,
392392
"metadata": {
393393
"collapsed": true
394394
},

0 commit comments

Comments
 (0)