Example #1
0
                  help="fold in [0,1,2,3,4]")

(options, args) = parser.parse_args()

fold = options.fold
batch_size = options.batch_size
mu = options.mu
epoch_num = 2000
sample_num_each_epoch = 500
patience = 25
best_epoch = 0
best_val_auc = 0.0
test_times = 20

if options.model_file == "":
    minet = MINet()
    minet = torch.nn.DataParallel(minet).cuda()
else:
    print('not implemented')

learning_rate = options.learning_rate

optimizer = torch.optim.Adam([{
    'params': minet.parameters()
}],
                             lr=learning_rate)

nn_loss_label = torch.nn.CrossEntropyLoss().cuda()

loss = 0
Example #2
0
(options, args) = parser.parse_args()

fold = options.fold
batch_size = options.batch_size
mu = options.mu
embed_len = 10
epoch_num = 2000
inst_num = 5
sample_num_each_epoch = 500
patience = 25
best_epoch = 0
best_val_auc = 0.0
test_times = 10

if options.model_file == "":
    minet = MINet(embed_len, inst_num)
    minet = torch.nn.DataParallel(minet).cuda()
else:
    print('not implemented')

learning_rate = options.learning_rate

optimizer = torch.optim.Adam([{
    'params': minet.parameters()
}],
                             lr=learning_rate)

nn_loss_label = torch.nn.CrossEntropyLoss().cuda()

loss = 0