예제 #1
0
def run2():

    rankers = []

    ranker_params = {
      'learning_rate': 0.1,
      'learning_rate_decay': 0.9999977,
    }
    sim_args, other_args = parser.parse_all_args(ranker_params)

    run_name = 'PDGD' 
    rankers.append((run_name, PDGD, other_args))

    run_name = 'DeepPDGD' 
    rankers.append((run_name, DeepPDGD, other_args))

    sim = DataSimulation(sim_args)
    sim.run(rankers)
예제 #2
0
def run1():

    rankers = []

    # NSGD with document space projection
    ranker_params = {
      'learning_rate_decay': 0.9999977,
      'k_initial': 3,
      'k_increase': False,
      'GRAD_SIZE':60,
      'EXP_SIZE':25,
      'TB_QUEUE_SIZE':10,
      'TB_WINDOW_SIZE':50,
      'prev_qeury_len': 10}
    sim_args, other_args = parser.parse_all_args(ranker_params)

    run_name = 'DSGD_TD_NSGD' 
    rankers.append((run_name, TD_NSGD_DSP, other_args))
    
    sim = DataSimulation(sim_args)
    sim.run(rankers)
예제 #3
0
def func_pairrank(args, dir_name):
    ranker_params = {
        "learning_rate": args.lr,
        "learning_rate_decay": args.lr_decay,
        "update": args.update,
        "_lambda": args.lmbd,
        "alpha": args.alpha,
        "refine": args.refine,
        "rank": args.rank,
        "ind": args.ind,
    }
    sim_args, other_args = parser.parse_all_args(ranker_params)
    if args.update == "gd" or args.update == "gd_diag" or args.update == "gd_recent":
        ranker_name = "None-None-{}-{}-{}-{}-{}-{}-{}".format(
            args.update,
            args.lmbd,
            args.alpha,
            args.refine,
            args.rank,
            args.ind,
            args.seed,
        )
    else:
        ranker_name = "{}-{}-{}-{}-{}-{}-{}-{}-{}".format(
            args.lr,
            args.lr_decay,
            args.update,
            args.lmbd,
            args.alpha,
            args.refine,
            args.rank,
            args.ind,
            args.seed,
        )

    run_name = dir_name + ranker_name
    ranker = [(run_name, PairRank, other_args)]
    sim = DataSimulation(sim_args)
    sim.run(ranker)
예제 #4
0
rankers = []
for vec in [50]:
    parser.set_argument('n_embedding_features', vec)
    ranker_params = {'conv_hist': 10}
    arg_str, args, sim_args, mgd_args, emb_args = parser.parse_all_args(ranker_params)

    run_name = 'PMGD19cand'
    rankers.append((arg_str, run_name, ProbMeanBandit, [mgd_args], {}))

    # run_name = 'DocSim_StaticKMeans_%dvectors' % vec
    # rankers.append((arg_str, run_name, StaticKMeans, [emb_args, mgd_args], ranker_params))
    #
    # ranker_params = {'gradient_weight': float(0), 'kernel': 'linear'}
    # arg_str, args, sim_args, mgd_args, emb_args = parser.parse_all_args(ranker_params)
    # run_name = 'DocSim_linear_%dvectors' % vec
    # rankers.append((arg_str, run_name, NormalizedSVMBandit, [emb_args, mgd_args], ranker_params))
    #
    # ranker_params = {'conv_hist': 10, 'change_threshold': 0.01, 'linear_renorm': False}
    # arg_str, args, sim_args, mgd_args, emb_args = parser.parse_all_args(ranker_params)
    # run_name = 'DocSim_cascade%dhist%sthres_linear_%dvectors' % (
    # ranker_params['conv_hist'], ranker_params['change_threshold'], vec)
    # rankers.append((arg_str, run_name, DocSim, [emb_args, mgd_args], ranker_params))
    #
    # ranker_params = {'conv_hist': 10, 'change_threshold': 0.01, 'linear_renorm': False}
    # arg_str, args, sim_args, mgd_args, emb_args = parser.parse_all_args(ranker_params)
    # run_name = 'DocSim_cascadeKMeans_%dvectors' % (vec)
    # rankers.append((arg_str, run_name, CascadeKMeans, [emb_args, mgd_args], ranker_params))

sim = DataSimulation(sim_args)
sim.run(rankers)