Ejemplo n.º 1
0
                'da':64,
                'r':4,
                'dropout':0.25,
    }

    args.cuda=torch.cuda.is_available()
    if(args.cuda==False):sys.exit("GPU is not available")
    torch.manual_seed(args.seed);torch.cuda.manual_seed(args.seed)

    # load dataset
    featrootdir=r'/home/liuzongming/feature_alstm_unnorm'
    cvtxtrootdir='../../../CV/folds'
    normfile=r'../temp1/ms{}.npy'.format(args.cvnum)

    dataset_train=AudioFeatureDataset(featrootdir=featrootdir, \
                                        cvtxtrootdir=cvtxtrootdir,feattype='npy', \
                                        cvnum=args.cvnum,mode='train',normflag=1,\
                                        normfile=normfile)

    dataset_eva=AudioFeatureDataset(featrootdir=featrootdir, \
                                        cvtxtrootdir=cvtxtrootdir,feattype='npy', \
                                        cvnum=args.cvnum,mode='eva',normflag=0,\
                                        normfile=normfile)


    dataset_test=AudioFeatureDataset(featrootdir=featrootdir, \
                                        cvtxtrootdir=cvtxtrootdir,feattype='npy', \
                                        cvnum=args.cvnum,mode='test',normflag=0,\
                                        normfile=normfile)


    print("shuffling dataset_train")
Ejemplo n.º 2
0
    'dropout': 0.0,
    'da': 128,
    'r': 4,
}

penaltyWeight = 0.01
emotion_labels = ('neu', 'hap', 'ang', 'sad')

args.cuda = torch.cuda.is_available()
if (args.cuda == False): sys.exit("GPU is not available")
torch.manual_seed(args.seed)
torch.cuda.manual_seed(args.seed)

# load dataset
dataset_train=AudioFeatureDataset(featrootdir=r'/mnt/c/chenhangting/Project/iemocap/chenhangting/features/basicfbank', \
                                    cvtxtrootdir='/mnt/c/chenhangting/Project/iemocap/chenhangting/CV/folds',feattype='npy', \
                                    cvnum=args.cvnum,mode='train',normflag=1,\
                                    normfile=r'/mnt/c/chenhangting/Project/iemocap/chenhangting/features/basicfbank/ms{}.npy'.format(args.cvnum))

dataset_eva=AudioFeatureDataset(featrootdir=r'/mnt/c/chenhangting/Project/iemocap/chenhangting/features/basicfbank', \
                                    cvtxtrootdir='/mnt/c/chenhangting/Project/iemocap/chenhangting/CV/folds',feattype='npy', \
                                    cvnum=args.cvnum,mode='eva',normflag=0,\
                                    normfile=r'/mnt/c/chenhangting/Project/iemocap/chenhangting/features/basicfbank/ms{}.npy'.format(args.cvnum))


dataset_test=AudioFeatureDataset(featrootdir=r'/mnt/c/chenhangting/Project/iemocap/chenhangting/features/basicfbank', \
                                    cvtxtrootdir='/mnt/c/chenhangting/Project/iemocap/chenhangting/CV/folds',feattype='npy', \
                                    cvnum=args.cvnum,mode='test',normflag=0,\
                                    normfile=r'/mnt/c/chenhangting/Project/iemocap/chenhangting/features/basicfbank/ms{}.npy'.format(args.cvnum))

print("shuffling dataset_train")
train_loader=torch.utils.data.DataLoader(dataset_train, \