def train(nn, reader, args):
    num_sents = len(reader.sentences)
    logger.debug("----------------------------------------------------")
    logger.debug("Starting training with %d sentences" % num_sents)
    
    avg_len = sum(len(x) for x in text_reader.sentences) / float(num_sents)
    logger.debug("Average sentence length is %.2f tokens" % avg_len)
    
    logger.debug("Network learning rate: %.2f" % nn.learning_rate)
    logger.debug("L2 normalization factor set to %.2f" % nn.l2_factor)
    logger.debug("Dropout factor set to %.2f" % nn.dropout)
    logger.debug("Maximum weight norm set to %.2f (0 means disabled)" % nn.max_norm)
    logger.debug("----------------------------------------------------\n")
    
    intervals = max(args.iterations / 200, 1)
    np.seterr(over='raise', divide='raise', invalid='raise')
    
    if args.task.startswith('srl') and args.task != 'srl_predicates':
        arg_limits = None if args.task != 'srl_classify' else text_reader.arg_limits
        
        nn.train(reader.sentences, reader.predicates, reader.tags, 
                 args.iterations, intervals, args.accuracy, arg_limits)
    
    elif args.task.endswith('dependency'): 
        if args.labeled:
            nn.train(reader.sentences, reader.heads, args.iterations, 
                     intervals, args.accuracy, text_reader.labels)
        else:
            nn.train(reader.sentences, reader.heads, args.iterations, 
                     intervals, args.accuracy)

    else:
        nn.train(reader.sentences, reader.tags, 
                 args.iterations, intervals, args.accuracy)
Tests that internal _directory_to_subdirs is updated on delete.
dataset/ETHPy150Open erickrf/nlpnet/bin/nlpnet-train.py/train--crossover with--dataset/ETHPy150Open GoogleCloudPlatform/python-compat-runtime/appengine-compat/exported_appengine_sdk/google/appengine/tools/devappserver2/inotify_file_watcher_test.py/TestInotifyFileWatcher.test_subdirectory_deleted