def InitNetwork(input_pattern, model_spec, mode='eval', initial_learning_rate=5e-05, final_learning_rate=5e-05, halflife=1600000, optimizer_type='Adam', num_preprocess_threads=1, reader=None):
 model = VGSLImageModel(mode, model_spec, initial_learning_rate, final_learning_rate, halflife)
 left_bracket = model_spec.find('[')
 right_bracket = model_spec.rfind(']')
 if ((left_bracket < 0) or (right_bracket < 0)):
  raise ValueError('Failed to find [] in model spec! ', model_spec)
 input_spec = model_spec[:left_bracket]
 layer_spec = model_spec[left_bracket:(right_bracket + 1)]
 output_spec = model_spec[(right_bracket + 1):]
 model.Build(input_pattern, input_spec, layer_spec, output_spec, optimizer_type, num_preprocess_threads, reader)
 return model

def InitNetwork ( input_pattern , model_spec , mode = 'eval' , initial_learning_rate = 5e-05 , final_learning_rate = 5e-05 , halflife = 1600000 , optimizer_type = 'Adam' , num_preprocess_threads = 1 , reader = None ) : model = VGSLImageModel ( mode , model_spec , initial_learning_rate , final_learning_rate , halflife ) left_bracket = model_spec . find ( '[' ) right_bracket = model_spec . rfind ( ']' ) if ( ( left_bracket < 0 ) or ( right_bracket < 0 ) ) : raise ValueError ( 'Failed to find [] in model spec! ' , model_spec ) input_spec = model_spec [ : left_bracket ] layer_spec = model_spec [ left_bracket : ( right_bracket + 1 ) ] output_spec = model_spec [ ( right_bracket + 1 ) : ] model . Build ( input_pattern , input_spec , layer_spec , output_spec , optimizer_type , num_preprocess_threads , reader ) return model
constructs a python tensor flow model defined by model_spec .