def create_network(args, text_reader, feature_tables, md):
    logger = logging.getLogger("Logger")
    
    is_dependency = 'dependency' in args.task
    is_convolution_srl =  args.task.startswith('srl') and args.task != 'srl_predicates'
    is_convolution = is_convolution_srl or is_dependency
    
    if is_convolution:
        # get some data structures used both by dep parsing and SRL
        distance_tables = utils.set_distance_features(args.max_dist, args.target_features,
                                                      args.pred_features)
        padding_left = text_reader.converter.get_padding_left(False)
        padding_right = text_reader.converter.get_padding_right(False)
    
        if is_dependency:
            output_size = 1 if not args.labeled else len(text_reader.tag_dict)
            nn = ConvolutionalDependencyNetwork.create_new(feature_tables, distance_tables[0], 
                                                           distance_tables[1], args.window, 
                                                           args.convolution, args.hidden, output_size)
        
        else:
            # not dependency (SRL)
            num_tags = len(text_reader.tag_dict)
            nn = ConvolutionalNetwork.create_new(feature_tables, distance_tables[0], 
                                                 distance_tables[1], args.window, 
                                                 args.convolution, args.hidden, num_tags)
            
            if args.identify:
                logger.info("Loading initial transition scores table for argument identification")
                transitions = srl.init_transitions_simplified(text_reader.tag_dict)
                nn.transitions = transitions
                
            elif not args.classify:
                logger.info("Loading initial IOB transition scores table")
                transitions = srl.init_transitions(text_reader.tag_dict, 'iob')
                nn.transitions = transitions
                
    else:
        # not convolution
        num_tags = len(text_reader.tag_dict)
        nn = Network.create_new(feature_tables, args.window, args.hidden, num_tags)
        transitions = np.zeros((num_tags + 1, num_tags), np.float)
        nn.transitions = transitions

        padding_left = text_reader.converter.get_padding_left(args.task == 'pos')
        padding_right = text_reader.converter.get_padding_right(args.task == 'pos')
    
    nn.padding_left = np.array(padding_left)
    nn.padding_right = np.array(padding_right)
    nn.learning_rate = args.learning_rate
    nn.l2_factor = args.l2
    nn.dropout = args.dropout
    nn.max_norm = args.max_norm
    
    if 'convolution' in args and args.convolution > 0 and args.hidden > 0:
        layer_sizes = (nn.input_size, nn.hidden_size, nn.hidden2_size, nn.output_size)
    else:
        layer_sizes = (nn.input_size, nn.hidden_size, nn.output_size)
    
    logger.info("Created new network with the following layer sizes: %s\n"
                % ', '.join(str(x) for x in layer_sizes))
    
    nn.network_filename = config.FILES[md.network]
    return nn
Creates and returns the neural network according to the task at hand.
dataset/ETHPy150Open erickrf/nlpnet/bin/nlpnet-train.py/create_network