forked from pulkitag/pycaffe-utils
/
my_examples.py
38 lines (34 loc) · 1.04 KB
/
my_examples.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import my_exp_config as mec
from easydict import EasyDict as edict
####### EXAMPLE 1 - CONFIGURING AN MNIST EXPERIMENT #########
##
#Define the experiment, snapshot and other required paths
def get_mnist_paths():
paths = edict()
#Path to store experiment details
paths.exp = edict()
paths.exp.dr = './test_data/mnist/exp'
#Paths to store snapshot details
paths.exp.snapshot = edict()
paths.exp.snapshot.dr = './test_data/mnist/snapshots'
return paths
##
#Define any parameters that may influence the experiment details
def get_mnist_prms():
prms = edict()
prms['expStr'] = 'mnist'
prms.paths = get_mnist_paths()
return prms
##
#Setup the experiment
def setup_experiment():
prms = get_mnist_prms()
nwPrms = {'netName': 'MyNet',
'baseNetDefProto': 'trainval.prototxt'}
cPrms = mec.get_solver_caffe_prms(mec.get_default_net_prms, nwPrms,
mec.get_default_solver_prms,
baseDefDir='./test_data/mnist')
exp = mec.CaffeSolverExperiment(prms, cPrms)
exp.make()
return exp
####### END OF EXAMPLE 1 ###################