def transformer_bce_kfold(fv): folds = list(range(1, 11)) for fold in folds: model_name = "transformer_%s_bce_fold%d" % (fv, fold) criterion = torch.nn.BCELoss(reduction='none') mtrain.train(fv, model_name, criterion, balance=False, batchsize=batchsize, fold=fold)
def fix_break_run(): folds = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] fv = 'matlab' for fold in folds: model_name = "transformer_%s_bce_fold%d" % (fv, fold) criterion = torch.nn.BCELoss(reduction='none') mtrain.train(fv, model_name, criterion, balance=False, batchsize=32, fold=fold)
def transformer_bce_gbalance(fv, size=0): model_name = "transformer_%s_size%d_bce_gbalance" % (fv, size) criterion = torch.nn.BCELoss(reduction='none') mtrain.train(fv, model_name, criterion, balance=True, batchsize=batchsize)
def transformer_fec1(fv, size=0): model_name = "transformer_%s_size%d_fec1" % (fv, size) criterion = torch_util.FECLoss(alpha=batchsize * 1, reduction='none') mtrain.train(fv, model_name, criterion)