Skip to content

Commit

Permalink
default param files
Browse files Browse the repository at this point in the history
git-svn-id: http://cuda-convnet.googlecode.com/svn/trunk@29 bc73d74b-de6f-cad7-86a4-6ddd3d5d919c
  • Loading branch information
akrizhevsky@gmail.com committed Jun 30, 2011
1 parent 522676a commit 83430d9
Show file tree
Hide file tree
Showing 8 changed files with 197 additions and 5 deletions.
2 changes: 1 addition & 1 deletion convdp.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def get_next_batch(self):
dic['labels'] = n.require(dic['labels'].T, requirements='C')
dic['num_real_cases'] = dic['data'].shape[1]

return epoch, batchnum, dic
return epoch, batchnum, dic['num_real_cases'], [dic['data'], dic['labels']]

def get_data_dims(self, idx=0):
return self.batch_meta['num_vis'] if idx == 0 else 1
11 changes: 9 additions & 2 deletions convnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,14 @@ def init_model_state(self):
ms['layers'] = LayerParser.parse_layers(self.layer_def, self.layer_params, self, ms['layers'])
else:
ms['layers'] = LayerParser.parse_layers(self.layer_def, self.layer_params, self)


def fill_excused_options(self):
if self.op.get_value('save_path') is None:
self.op.set_value('save_path', "")
self.op.set_value('train_batch_range', '0')
self.op.set_value('test_batch_range', '0')
self.op.set_value('data_path', '')

# Not necessary here
def parse_batch_data(self, batch_data, train=True):
return batch_data
Expand Down Expand Up @@ -86,7 +93,7 @@ def aggregate_test_outputs(self, test_outputs):
op.add_option("mini", "minibatch_size", IntegerOptionParser, "Minibatch size", default=128)
op.add_option("layer-def", "layer_def", StringOptionParser, "Layer definition file", set_once=True)
op.add_option("layer-params", "layer_params", StringOptionParser, "Layer parameter file")
op.add_option("check-grads", "check_grads", BooleanOptionParser, "Check gradients and quit?", default=0)
op.add_option("check-grads", "check_grads", BooleanOptionParser, "Check gradients and quit?", default=0, excuses=['data_path','save_path','train_batch_range','test_batch_range'])

op.delete_option('max_test_err')
op.options["max_filesize_mb"].default = 0
Expand Down
30 changes: 30 additions & 0 deletions layer-params.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[conv32]
epsW=0.001
epsB=0.002
momW=0.9
momB=0.9
wc=0

[fc1024]
momW=0.9
momB=0.9
epsW=0.00001
epsB=0.00002
wc=0

[conv32-2]
epsW=0.001
epsB=0.002
momW=0.9
momB=0.9
wc=0

[fc10]
epsW=0.0001,0.001
epsB=0.002
momW=0.5,0.9
momB=0.9
wc=0,0

[logprob]
coeff=1
30 changes: 30 additions & 0 deletions layer-params.gc.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[conv32]
epsW=0.001
epsB=0.002
momW=0.9
momB=0.9
wc=0

#[fc2048]
#wc=0
#momB=0
#momW=0
#epsW=0.00000001
#epsB=0.0002

[conv32-2]
epsW=0.001
epsB=0.002
momW=0.9
momB=0.9
wc=0

[fc10]
wc=0
momB=0
momW=0
epsW=0.00001
epsB=0.00002

[logprob]
coeff=1
63 changes: 63 additions & 0 deletions layers.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
[data]
type=data
dataIdx=0

[labels]
type=data
dataIdx=1

[conv32]
type=conv
inputs=data
channels=3
numFilters=32
padding=4
stride=1
filterSize=9
neuron=logistic
initW=0.00001
partialSum=1

[fc1024]
type=fc
numOutputs=1024
inputs=data
initW=0.001
neuron=relu

[maxpool]
type=pool
pool=max
inputs=conv32
start=0
subsX=4
stride=2
outputsX=0
channels=32

[conv32-2]
type=conv
inputs=maxpool
numFilters=32
padding=2
stride=1
filterSize=5
channels=32
neuron=relu
initW=0.0001
partialSum=1

[fc10]
type=fc
numOutputs=10
inputs=conv32-2,fc1024
initW=0.001,0.001
neuron=ident

[probs]
type=softmax
inputs=fc10

[logprob]
type=cost.logreg
inputs=labels,probs
63 changes: 63 additions & 0 deletions layers.gc.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
[data]
type=data
dataIdx=0

[labels]
type=data
dataIdx=1

[conv32]
type=conv
inputs=data
numFilters=16
padding=0
stride=1
filterSize=3
channels=3
neuron=ident
initW=0.1
partialSum=1

#[fc2048]
#type=fc
#numOutputs=2048
#inputs=data
#initW=0.001
#neuron=ident

#[maxpool]
#type=pool
#pool=avg
#inputs=conv32
#start=-2
#subsX=4
#stride=4
#outputsX=0
#channels=32

[conv32-2]
type=conv
inputs=conv32
numFilters=16
padding=2
stride=3
filterSize=5
channels=16
neuron=ident
initW=0.1
partialSum=1

[fc10]
type=fc
numOutputs=10
inputs=conv32-2
initW=0.8
neuron=ident

[probs]
type=softmax
inputs=fc10

[logprob]
type=cost.logreg
inputs=labels,probs
2 changes: 1 addition & 1 deletion options.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def add_option(self, letter, name, parser, desc, set_once=False, default=None, e
assert name not in self.options
self.options[name] = Option(letter, name, desc, parser, set_once, default, excuses, requires, save)

def set_option(self, name, value, parse=True):
def set_value(self, name, value, parse=True):
self.options[name].set_value(value, parse=parse)

def get_value(self, name):
Expand Down
1 change: 0 additions & 1 deletion src/matrix.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/*
* File: layer.cu
* Author: Alex Krizhevsky (akrizhevsky@gmail.com)
*/

Expand Down

0 comments on commit 83430d9

Please sign in to comment.