<s> import numpy as np <EOL> import theano . tensor as T <EOL> from mozi . datasets . voc import VOC <EOL> from mozi . model import Sequential <EOL> from mozi . layers . alexnet import Alexnet <EOL> from mozi . log import Log <EOL> from mozi . train_object import TrainObject <EOL> from mozi . cost import error , entropy <EOL> from mozi . learning_method import SGD <EOL> from mozi . env import setenv <EOL> import os <EOL> import theano <EOL> def train ( ) : <EOL> data = VOC ( batch_size = <NUM_LIT:32> , train_valid_test_ratio = [ <NUM_LIT:5> , <NUM_LIT:1> , <NUM_LIT:1> ] ) <EOL> model = Sequential ( input_var = T . tensor4 ( ) , output_var = T . matrix ( ) ) <EOL> model . add ( Alexnet ( input_shape = ( <NUM_LIT:3> , <NUM_LIT> , <NUM_LIT> ) , output_dim = <NUM_LIT:11> ) ) <EOL> learning_method = SGD ( learning_rate = <NUM_LIT> , momentum = <NUM_LIT> , <EOL> lr_decay_factor = <NUM_LIT> , decay_batch = <NUM_LIT> ) <EOL> train_object = TrainObject ( model = model , <EOL> log = None , <EOL> dataset = data , <EOL> train_cost = error , <EOL> valid_cost = error , <EOL> learning_method = learning_method , <EOL> stop_criteria = { '<STR_LIT>' : <NUM_LIT:10> , <EOL> '<STR_LIT>' : <NUM_LIT:5> , <EOL> '<STR_LIT>' : <NUM_LIT> } <EOL> ) <EOL> train_object . setup ( ) <EOL> train_object . run ( ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> setenv ( ) <EOL> train ( ) </s>
