if args.only_cpu:
        ONLY_CPU = True

    if args.minimize_mode:
        OPTIMIZE_MODE = "min"

if __name__ == "__main__":
    parser = argparse.ArgumentParser("Start bi model tuning with hyperspace and resiliency testing, "
                                     "specify output csv file name.")
    parser.add_argument("-o", "--out", required=True)
    parser.add_argument("-m", "--model")
    parser.add_argument("-t", "--trials")
    parser.add_argument("-j", "--json")
    parser.add_argument('-d', "--max_diff", action="store_true")
    parser.add_argument('-r', '--minimize_resiliency', action="store_true")
    parser.add_argument('-l', '--on_lambda', action="store_true")
    parser.add_argument('-n', '--start_space')
    parser.add_argument('-c', '--only_cpu', action='store_true')
    parser.add_argument('-p', '--project_name', default="hyper_sensitive")
    parser.add_argument('--minimize_mode', action="store_true")
    args = parser.parse_args()
    bitune_parse_arguments(args)
    # print(PT_MODEL)
    print(OPTIMIZE_MODE)
    if args.on_lambda:
        spaceray.run_experiment(args, multi_train, ray_dir="~/raylogs", cpu=8, start_space=int(args.start_space),
                                mode=OPTIMIZE_MODE)
    else:
        spaceray.run_experiment(args, multi_train, ray_dir="/lus/theta-fs0/projects/CVD-Mol-AI/mzvyagin/raylogs", cpu=8,
                                start_space=int(args.start_space), mode=OPTIMIZE_MODE, project_name=args.project_name,
                                group_name='bi_tune')
Ejemplo n.º 2
0
from hyper_resilient_experiments.alexnet_cifar import pytorch_alexnet, tensorflow_alexnet
import spaceray
from ray import tune


class Namespace:
    def __init__(self, **kwargs):
        self.__dict__.update(kwargs)


def objective(config):
    acc, model = tensorflow_alexnet.cifar100_tf_objective(config)
    search_results = {'average_res': acc}
    tune.report(**search_results)
    return search_results


if __name__ == "__main__":
    args = Namespace(json='../standard.json',
                     trials=10,
                     out='tensorflow_benchmark.csv')
    spaceray.run_experiment(
        args,
        objective,
        ray_dir="/lus/theta-fs0/projects/CVD-Mol-AI/mzvyagin/raylogs",
        cpu=8,
        start_space=0,
        mode="max")

if __name__ == "__main__":
    parser = argparse.ArgumentParser(
        "Start bi model tuning with hyperspace and resiliency testing, "
        "specify output csv file name.")
    parser.add_argument("-o", "--out", required=True)
    parser.add_argument("-m", "--model")
    parser.add_argument("-t", "--trials")
    parser.add_argument("-j", "--json")
    parser.add_argument('-d', "--max_diff", action="store_true")
    parser.add_argument('-r', '--minimize_resiliency', action="store_true")
    parser.add_argument('-l', '--on_lambda', action="store_true")
    parser.add_argument('-f', '--framework', required=True)
    parser.add_argument('-n', '--start_space')
    args = parser.parse_args()
    bitune_parse_arguments(args)
    # print(PT_MODEL
    if args.on_lambda:
        spaceray.run_experiment(args,
                                double_train,
                                ray_dir="~/raylogs",
                                cpu=8,
                                start_space=int(args.start_space))
    else:
        spaceray.run_experiment(
            args,
            double_train,
            ray_dir="/lus/theta-fs0/projects/CVD-Mol-AI/mzvyagin/raylogs",
            cpu=8,
            start_space=int(args.start_space))
Ejemplo n.º 4
0
import numpy as np
import argparse
import torch
import spaceray
from ray import tune


def objective(config):
    search_results = {}
    average_res = np.random.rand()
    search_results['average_res'] = average_res
    tune.report(**search_results)
    return search_results


if __name__ == "__main__":
    parser = argparse.ArgumentParser(
        "Start bi model tuning with hyperspace and resiliency testing, "
        "specify output csv file name.")
    parser.add_argument("-o", "--out", required=True)
    parser.add_argument("-m", "--model")
    parser.add_argument("-t", "--trials")
    parser.add_argument("-j", "--json")
    # print(NUM_CLASSES)
    args = parser.parse_args()
    spaceray.run_experiment(
        args,
        objective,
        cpu=8,
        ray_dir="/lus/theta-fs0/projects/CVD-Mol-AI/mzvyagin/raylogs")
        print("NOTE: Training using Max Diff approach")

    if args.minimize_resiliency:
        MIN_RESILIENCY = True
        print("NOTE: Training using Min Resiliency approach")


if __name__ == "__main__":
    parser = argparse.ArgumentParser(
        "Start bi model tuning with hyperspace and resiliency testing, "
        "specify output csv file name.")
    parser.add_argument("-o", "--out", required=True)
    parser.add_argument("-t", "--trials")
    parser.add_argument("-j", "--json")
    parser.add_argument('-d', "--max_diff", action="store_true")
    parser.add_argument('-r', '--minimize_resiliency', action="store_true")
    parser.add_argument('-l', '--on_lambda', action="store_true")
    args = parser.parse_args()
    bitune_parse_arguments(args)
    # print(PT_MODEL)
    if args.on_lambda:
        spaceray.run_experiment(args,
                                segmentation_multi_train,
                                ray_dir="~/raylogs",
                                cpu=8)
    else:
        spaceray.run_experiment(
            args,
            segmentation_multi_train,
            ray_dir="/lus/theta-fs0/projects/CVD-Mol-AI/mzvyagin/raylogs",
            cpu=8)