def build_model(args, i_cv): args.net = ARCHI(n_in=29, n_out=2, n_unit=args.n_unit) args.adv_net = ARCHI(n_in=2, n_out=2, n_unit=args.n_unit) args.net_optimizer = get_optimizer(args) args.adv_optimizer = get_optimizer(args, args.adv_net) args.net_criterion = WeightedCrossEntropyLoss() args.adv_criterion = WeightedGaussEntropyLoss() model = get_model(args, PivotClassifier) model.set_info(DATA_NAME, BENCHMARK_NAME, i_cv) return model
def build_model(args, i_cv): args.net = ARCHI(n_in=3, n_out=2, n_unit=args.n_unit) args.optimizer = get_optimizer(args) model = get_model(args, NeuralNetClassifier) model.base_name = "DataAugmentation" model.set_info(DATA_NAME, BENCHMARK_NAME, i_cv) return model
def build_model(args, i_cv): args.net = ARCHI(n_in=29, n_out=N_BINS, n_unit=args.n_unit) args.optimizer = get_optimizer(args) args.criterion = HiggsLoss() model = get_model(args, Inferno) model.set_info(DATA_NAME, BENCHMARK_NAME, i_cv) return model
def load_some_NN(i_cv=0, cuda=False): from model.neural_network import NeuralNetClassifier from archi.classic import L4 as ARCHI import torch.optim as optim n_unit = 200 net = ARCHI(n_in=29, n_out=2, n_unit=n_unit) optimizer = optim.Adam(net.parameters(), lr=1e-3) model = NeuralNetClassifier(net, optimizer, n_steps=15000, batch_size=10000, cuda=cuda) model.set_info(DATA_NAME, BENCHMARK_NAME, i_cv) print(f"loading {model.model_path}") model.load(model.model_path) return model
def build_model(args, i_cv): args.net = ARCHI(n_in=1, n_out=2, n_unit=args.n_unit) args.optimizer = get_optimizer(args) model = get_model(args, TangentPropClassifier) model.set_info(DATA_NAME, BENCHMARK_NAME, i_cv) return model
def build_model(args, i_cv): args.net = ARCHI(n_in=1, n_out=2, n_unit=args.n_unit) args.optimizer = get_optimizer(args) model = get_model(args, NeuralNetClassifier) model.set_info(DATA_NAME, f"{BENCHMARK_NAME}/learning_curve", i_cv) return model