示例#1
0
文件: submit.py 项目: ttrine/speed
from container import ModelContainer
from experiments.conv_test.train import construct

if __name__ == '__main__':
	import sys # basic arg parsing, infer name
	name = sys.argv[0].split('/')[-2]
	
	if len(sys.argv) < 2:
		print "Usage: submit weight_file"
		sys.exit()

	c = ModelContainer(name,construct(),10,"adam")
	c.evaluate(str(sys.argv[1]))
示例#2
0
    fcn = Dropout(.5)(fcn)
    fcn = Dense(128)(fcn)
    fcn = Dense(1)(fcn)

    return Model(input=inp, output=fcn)


datagen_args = dict(rotation_range=5.,
                    width_shift_range=0.1,
                    height_shift_range=0.1,
                    zoom_range=.1,
                    channel_shift_range=0.,
                    horizontal_flip=False)

if __name__ == '__main__':
    import sys  # basic arg parsing, infer name

    if len(sys.argv) < 4:
        print "Usage: train nb_epoch batch_size samples_per_epoch"
        sys.exit()

    name = sys.argv[0].split('/')[-2]

    model = ModelContainer(name,
                           construct(),
                           "adam",
                           datagen_args=datagen_args)
    model.train(nb_epoch=int(sys.argv[1]),
                batch_size=int(sys.argv[2]),
                samples_per_epoch=int(sys.argv[3]))