Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] fig a bug of abmil #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 19 additions & 13 deletions train_mil.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
import argparse
import copy
import itertools
import os
import sys
from collections import OrderedDict
from tkinter.messagebox import NO

import numpy as np
import pandas as pd
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
from torch.autograd import Variable
import torchvision.transforms.functional as VF
from torchvision import transforms

import sys, argparse, os, copy, itertools
import pandas as pd
import numpy as np
from sklearn.utils import shuffle
from sklearn.metrics import roc_curve, roc_auc_score, precision_recall_fscore_support
from sklearn.datasets import load_svmlight_file
from collections import OrderedDict
from sklearn.metrics import (precision_recall_fscore_support, roc_auc_score,
roc_curve)
from sklearn.utils import shuffle
from torch.autograd import Variable
from torch.utils.data import DataLoader
from torchvision import transforms


def get_data(file_path):
Expand Down Expand Up @@ -121,8 +127,8 @@ def main():

if args.model == 'dsmil':
import dsmil as mil
elif args.model == 'abmil':
import abmil as mil
else:
raise NotImplementedError

if args.datasets == 'musk1':
data_all = get_data('datasets/mil_dataset/Musk/musk1norm.svm')
Expand Down Expand Up @@ -188,4 +194,4 @@ def main():


if __name__ == '__main__':
main()
main()