Ejemplo n.º 1
0
def run_experiments_seed(domain="restaurants", gpu=-1, patience=10, cosinelr=False, fullsimplify=True, batsize=50,
                         smoothing=0.2, dropout=.1, numlayers=3, numheads=12, hdim=768, useall=False, domainstart=False,
                         nopretrain=False, numbeam=1, onlyabstract=False, uselexicon=False):
    ranges = {
        "lr": [0.0001],
        "ftlr": [0.0001],
        "enclrmul": [0.1],
        "warmup": [2],
        "epochs": [100],
        "pretrainepochs": [100],
        "numheads": [numheads],
        "numlayers": [numlayers],
        "dropout": [dropout],
        "smoothing": [smoothing],
        "hdim": [hdim],
        "numbeam": [numbeam],
        "batsize": [batsize],
        "seed": [12345678, 65748390, 98387670, 23655798, 66453829],     # TODO: add more later
    }
    p = __file__ + f".{domain}"
    def check_config(x):
        effectiveenclr = x["enclrmul"] * x["lr"]
        if effectiveenclr < 0.000005:
            return False
        dimperhead = x["hdim"] / x["numheads"]
        if dimperhead < 20 or dimperhead > 100:
            return False
        return True

    q.run_experiments(run, ranges, path_prefix=p, check_config=check_config,
                      domain=domain, fullsimplify=fullsimplify,
                      gpu=gpu, patience=patience, cosinelr=cosinelr,
                      domainstart=domainstart, useall=useall, uselexicon=uselexicon,
                      nopretrain=nopretrain, onlyabstract=onlyabstract)
Ejemplo n.º 2
0
def run_experiments(domain="restaurants", gpu=-1, patience=10, cosinelr=False, mincoverage=2, fullsimplify=True, uselexicon=False):
    ranges = {
        "lr": [0.0001, 0.00001], #[0.001, 0.0001, 0.00001],
        "ftlr": [0.00003],
        "enclrmul": [1., 0.1], #[1., 0.1, 0.01],
        "warmup": [2],
        "epochs": [100], #[50, 100],
        "pretrainepochs": [100],
        "numheads": [8, 12, 16],
        "numlayers": [3, 6, 9],
        "dropout": [.1],
        "hdim": [768, 960], #[192, 384, 768, 960],
        "seed": [12345678], #, 98387670, 23655798, 66453829],      # TODO: add more later
    }
    p = __file__ + f".{domain}"
    def check_config(x):
        effectiveenclr = x["enclrmul"] * x["lr"]
        if effectiveenclr < 0.00001:
            return False
        dimperhead = x["hdim"] / x["numheads"]
        if dimperhead < 20 or dimperhead > 100:
            return False
        return True

    q.run_experiments(run, ranges, path_prefix=p, check_config=check_config,
                      domain=domain, fullsimplify=fullsimplify, uselexicon=uselexicon,
                      gpu=gpu, patience=patience, cosinelr=cosinelr, mincoverage=mincoverage)
Ejemplo n.º 3
0
def run_experiments_seed(domain="restaurants",
                         hdim=-1,
                         dropout=-1.,
                         numlayers=-1,
                         numheads=-1,
                         gpu=-1):
    ranges = {
        "lr": [0.0001],
        "enclrmul": [0.1],
        "warmup": [0],
        "epochs": [50],
        "numheads": [16],
        "numlayers": [3],
        "dropout": [.1],
        "hdim": [960],
        "cosinelr": [True],
        "seed": [12345678, 65748390, 98387670, 23655798,
                 66453829],  # TODO: add more later
    }
    if hdim > 0:
        ranges["hdim"] = [hdim]
    if dropout > 0:
        ranges["dropout"] = [dropout]
    if numlayers > 0:
        ranges["numlayers"] = [numlayers]
    if numheads > 0:
        ranges["numheads"] = [numheads]
    p = __file__ + f".{domain}"

    def check_config(x):
        effectiveenclr = x["enclrmul"] * x["lr"]
        if effectiveenclr < 0.000005:
            return False
        dimperhead = x["hdim"] / x["numheads"]
        if dimperhead < 20 or dimperhead > 100:
            return False
        return True

    q.run_experiments(run,
                      ranges,
                      path_prefix=p,
                      check_config=check_config,
                      domain=domain,
                      gpu=gpu,
                      trainonvalid=False)
Ejemplo n.º 4
0
def run_experiments(domain="restaurants", gpu=-1):
    ranges = {
        "lr": [0.0001, 0.00001],  #[0.001, 0.0001, 0.00001],
        "enclrmul": [1., 0.1],  #[1., 0.1, 0.01],
        "warmup": [2],
        "epochs": [100],  #[50, 100],
        "numheads": [8, 12, 16],
        "numlayers": [3, 6, 9],
        "dropout": [.1, .2],
        "hdim": [384, 768, 960],  #[192, 384, 768, 960],
        "seed":
        [12345678
         ],  #, 98387670, 23655798, 66453829],     # TODO: add more later
        "cosinelr": [True],
    }
    ranges = {
        "lr": [0.0001],
        "enclrmul": [0.1],
        "warmup": [0],
        "epochs": [50, 100, 75],
        "numheads": [16],
        "numlayers": [3],
        "dropout": [.1],
        "hdim": [960],
        "cosinelr": [True],
        "seed": [12345678],  # TODO: add more later
    }
    p = __file__ + f".{domain}"

    def check_config(x):
        effectiveenclr = x["enclrmul"] * x["lr"]
        if effectiveenclr < 0.00001:
            return False
        dimperhead = x["hdim"] / x["numheads"]
        if dimperhead < 20 or dimperhead > 100:
            return False
        return True

    q.run_experiments(run,
                      ranges,
                      path_prefix=p,
                      check_config=check_config,
                      domain=domain,
                      gpu=gpu)
Ejemplo n.º 5
0
def run_experiments_seed(domain="default", gpu=-1, patience=10, cosinelr=False, fullsimplify=True, batsize=50,
                         smoothing=0.2, dropout=.1, decoderdropout=0.5, numlayers=3, numheads=12, hdim=768, pretrainbatsize=100,
                         resetmode="none", mincoverage=2,
                         nopretrain=False, numbeam=1, onlyabstract=False, pretrainsetting="all", finetunesetting="min",
                         epochs=67, pretrainepochs=60, minpretrainepochs=10):
    ranges = {
        "domain": ["recipes", "restaurants", "blocks", "calendar", "housing", "publications"],
        "lr": [0.0001],
        "ftlr": [0.0001],
        "enclrmul": [0.1],
        "warmup": [2],
        "epochs": [epochs],
        "pretrainepochs": [pretrainepochs],
        "numheads": [numheads],
        "numlayers": [numlayers],
        "dropout": [dropout],
        "decoderdropout": [decoderdropout],
        "smoothing": [smoothing],
        "hdim": [hdim],
        "numbeam": [numbeam],
        "batsize": [batsize],
        "seed": [12345678, 65748390, 98387670, 23655798, 66453829],     # TODO: add more later
    }
    p = __file__ + f".{domain}"
    if domain != "default":
        ranges["domain"] = [domain]
    def check_config(x):
        effectiveenclr = x["enclrmul"] * x["lr"]
        if effectiveenclr < 0.000005:
            return False
        dimperhead = x["hdim"] / x["numheads"]
        if dimperhead < 20 or dimperhead > 100:
            return False
        return True

    q.run_experiments(run, ranges, path_prefix=p, check_config=check_config, mincoverage=mincoverage,
                      domain=domain, fullsimplify=fullsimplify, resetmode=resetmode,
                      gpu=gpu, patience=patience, cosinelr=cosinelr, pretrainbatsize=pretrainbatsize,
                      pretrainsetting=pretrainsetting, finetunesetting=finetunesetting,
                      nopretrain=nopretrain, onlyabstract=onlyabstract, minpretrainepochs=minpretrainepochs)
Ejemplo n.º 6
0
def run_experiments(domain="restaurants", gpu=-1, patience=10, cosinelr=False,
                    ptN=3000, datatemp=.33):
    ranges = {
        "lr": [0.0001],
        "ptlr": [0.0001],
        "enclrmul": [1.],
        "warmup": [1],
        "ptwarmup": [5],
        "epochs": [100],
        "ptepochs": [100],
        "ptbatsize": [120],
        "numheads": [16],
        "numlayers": [3],
        "dropout": [.1],
        "hdim": [960],
        "tokenmaskp": [0., .2],
        "spanmaskp": [0., .2],
        "treemaskp": [0., .2],
        "seed": [12345678],     # TODO: add more later
    }
    p = __file__ + f".{domain}"
    def check_config(x):
        effectiveenclr = x["enclrmul"] * x["lr"]
        if effectiveenclr < 0.00001:
            return False
        dimperhead = x["hdim"] / x["numheads"]
        if dimperhead < 20 or dimperhead > 100:
            return False
        if x["tokenmaskp"] + x["spanmaskp"] + x["treemaskp"] > .2:
            return False
        if x["tokenmaskp"] + x["spanmaskp"] + x["treemaskp"] == .0:
            return False
        return True

    q.run_experiments(run, ranges, path_prefix=p, check_config=check_config,
                      domain=domain, gpu=gpu, patience=patience, cosinelr=cosinelr,
                      ptN=ptN, datatemp=datatemp)
Ejemplo n.º 7
0
def run_experiments_seed(domain="restaurants", gpu=-1, patience=5, cosinelr=False,):
    ranges = {
        "lr": [0.0001],
        "enclrmul": [0.1],
        "warmup": [1],
        "epochs": [75],
        "numheads": [16],
        "numlayers": [3],
        "dropout": [.1],
        "hdim": [960],
        "seed": [12345678, 65748390, 98387670, 23655798, 66453829],     # TODO: add more later
    }
    p = __file__ + f".{domain}"
    def check_config(x):
        effectiveenclr = x["enclrmul"] * x["lr"]
        if effectiveenclr < 0.000005:
            return False
        dimperhead = x["hdim"] / x["numheads"]
        if dimperhead < 20 or dimperhead > 100:
            return False
        return True

    q.run_experiments(run, ranges, path_prefix=p, check_config=check_config,
                      domain=domain, gpu=gpu, patience=patience, cosinelr=cosinelr)
Ejemplo n.º 8
0
def _run_experiments(domain="restaurants", gpu=-1, patience=5, cosinelr=False,):
    ranges = {
        "lr": [0.001, 0.0001, 0.00001],
        "enclrmul": [1., 0.1, 0.01],
        "warmup": [0, 2],
        "epochs": [50, 100],
        "numheads": [8, 12, 16],
        "numlayers": [3, 6, 9],
        "dropout": [.1, .05, .2],
        "hdim": [192, 384, 768, 960],
        "seed": [12345678],     # TODO: add more later
    }
    p = __file__ + f".{domain}"
    def check_config(x):
        effectiveenclr = x["enclrmul"] * x["lr"]
        if effectiveenclr < 0.00001:
            return False
        dimperhead = x["hdim"] / x["numheads"]
        if dimperhead < 20 or dimperhead > 100:
            return False
        return True

    q.run_experiments(run, ranges, path_prefix=p, check_config=check_config,
                      domain=domain, gpu=gpu, patience=patience, cosinelr=cosinelr)
def run_experiments_seed(domain="restaurants",
                         lr=-1.,
                         batsize=-1,
                         patience=-1,
                         enclrmul=-1.,
                         hdim=-1,
                         dropout=-1.,
                         encdropout=-1.,
                         numlayers=-1,
                         numheads=-1,
                         gpu=-1,
                         epochs=-1,
                         trainonvalid=False,
                         cosinelr=False):
    ranges = {
        "lr": [0.00005],
        "batsize": [8],
        "patience": [14],
        "enclrmul": [0.1],
        "warmup": [0],
        "epochs": [50],
        "numheads": [12],
        "numlayers": [8],
        "dropout": [.2],
        "encdropout": [.1],
        "hdim": [768],
        "cosinelr": [cosinelr],
        "seed": [12345678, 65748390, 98387670],  # TODO: add more later
    }
    if lr >= 0:
        ranges["lr"] = [lr]
    if batsize >= 0:
        ranges["batsize"] = [batsize]
    if patience >= 0:
        ranges["patience"] = [patience]
    if hdim >= 0:
        ranges["hdim"] = [hdim]
    if dropout >= 0:
        ranges["dropout"] = [dropout]
    if encdropout >= 0.:
        ranges["encdropout"] = [encdropout]
    if numlayers >= 0:
        ranges["numlayers"] = [numlayers]
    if numheads >= 0:
        ranges["numheads"] = [numheads]
    if enclrmul >= 0:
        ranges["enclrmul"] = [enclrmul]
    if epochs >= 0:
        ranges["epochs"] = [epochs]
    p = __file__ + f".{domain}"

    def check_config(x):
        effectiveenclr = x["enclrmul"] * x["lr"]
        # if effectiveenclr < 0.000005:
        #     return False
        dimperhead = x["hdim"] / x["numheads"]
        if dimperhead < 20 or dimperhead > 100:
            return False
        return True

    q.run_experiments(run,
                      ranges,
                      path_prefix=p,
                      check_config=check_config,
                      domain=domain,
                      gpu=gpu,
                      trainonvalid=trainonvalid)
Ejemplo n.º 10
0
def run_experiments_seed(sourcelang="en",
                         supportlang="en",
                         testlang="en",
                         lr=-1.,
                         batsize=-1,
                         patience=-1,
                         enclrmul=-1.,
                         hdim=-1,
                         dropout=-1.,
                         dropoutdec=-1.,
                         numlayers=-1,
                         numheads=-1,
                         gpu=-1,
                         epochs=-1,
                         smoothing=0.,
                         numbeam=1,
                         trainonvalid=False,
                         cosinelr=False,
                         statesimweight=0.,
                         probsimweight=0.,
                         projmode="simple",
                         seed=-1):
    ranges = {
        "lr": [0.0001],
        "batsize": [20],
        "patience": [5],
        "enclrmul": [0.1],
        "warmup": [0],
        "epochs": [50],
        "numheads": [12],
        "numlayers": [5],
        "dropout": [.1],
        "dropoutdec": [.1],
        "hdim": [768],
        "cosinelr": [cosinelr],
        "seed": [12345678, 65748390, 98387670, 23655798,
                 66453829],  # TODO: add more later
    }
    if lr >= 0:
        ranges["lr"] = [lr]
    if batsize >= 0:
        ranges["batsize"] = [batsize]
    if patience >= 0:
        ranges["patience"] = [patience]
    if hdim >= 0:
        ranges["hdim"] = [hdim]
    if dropout >= 0:
        ranges["dropout"] = [dropout]
    if dropoutdec >= 0:
        ranges["dropoutdec"] = [dropoutdec]
    if numlayers >= 0:
        ranges["numlayers"] = [numlayers]
    if numheads >= 0:
        ranges["numheads"] = [numheads]
    if enclrmul >= 0:
        ranges["enclrmul"] = [enclrmul]
    if epochs >= 0:
        ranges["epochs"] = [epochs]
    if seed >= 0:
        ranges["seed"] = [seed]
    p = __file__ + f".{sourcelang}-{supportlang}-{testlang}"

    def check_config(x):
        effectiveenclr = x["enclrmul"] * x["lr"]
        # if effectiveenclr < 0.000005:
        #     return False
        dimperhead = x["hdim"] / x["numheads"]
        if dimperhead < 20 or dimperhead > 100:
            return False
        return True

    q.run_experiments(run,
                      ranges,
                      path_prefix=p,
                      check_config=check_config,
                      sourcelang=sourcelang,
                      supportlang=supportlang,
                      testlang=testlang,
                      gpu=gpu,
                      smoothing=smoothing,
                      numbeam=numbeam,
                      trainonvalid=trainonvalid,
                      statesimweight=statesimweight,
                      probsimweight=probsimweight,
                      projmode=projmode)