示例#1
0
    valid_loader = None

if args.cuda:
    device = get_freer_gpu()
else:
    device = None

if args.model == 'mfcc':
    model = model_.cnn_lstm_mfcc(n_z=args.latent_size,
                                 proj_size=len(train_dataset.speakers_list)
                                 if args.softmax != 'none' else 0,
                                 ncoef=args.ncoef,
                                 sm_type=args.softmax)
elif args.model == 'fb':
    model = model_.cnn_lstm_fb(n_z=args.latent_size,
                               proj_size=len(train_dataset.speakers_list)
                               if args.softmax != 'none' else 0,
                               sm_type=args.softmax)
elif args.model == 'resnet_fb':
    model = model_.ResNet_fb(n_z=args.latent_size,
                             proj_size=len(train_dataset.speakers_list)
                             if args.softmax != 'none' else 0,
                             sm_type=args.softmax)
elif args.model == 'resnet_mfcc':
    model = model_.ResNet_mfcc(n_z=args.latent_size,
                               proj_size=len(train_dataset.speakers_list)
                               if args.softmax != 'none' else 0,
                               ncoef=args.ncoef,
                               sm_type=args.softmax)
elif args.model == 'resnet_lstm':
    model = model_.ResNet_lstm(n_z=args.latent_size,
                               proj_size=len(train_dataset.speakers_list)
示例#2
0
    if args.cp_path is None:
        raise ValueError(
            'There is no checkpoint/model path. Use arg --cp-path to indicate the path!'
        )

    print('Cuda Mode is: {}'.format(args.cuda))

    if args.cuda:
        set_device()

    if args.model == 'mfcc':
        model = model_.cnn_lstm_mfcc(n_z=args.latent_size,
                                     proj_size=None,
                                     ncoef=args.ncoef)
    elif args.model == 'fb':
        model = model_.cnn_lstm_fb(n_z=args.latent_size, proj_size=None)
    elif args.model == 'resnet_fb':
        model = model_.ResNet_fb(n_z=args.latent_size, proj_size=None)
    elif args.model == 'resnet_mfcc':
        model = model_.ResNet_mfcc(n_z=args.latent_size,
                                   proj_size=None,
                                   ncoef=args.ncoef)
    elif args.model == 'resnet_lstm':
        model = model_.ResNet_lstm(n_z=args.latent_size,
                                   proj_size=None,
                                   ncoef=args.ncoef)
    elif args.model == 'resnet_stats':
        model = model_.ResNet_stats(n_z=args.latent_size,
                                    proj_size=None,
                                    ncoef=args.ncoef)
    elif args.model == 'lcnn9_mfcc':
示例#3
0
            'There is no checkpoint/model path. Use arg --cp-path to indicate the path!'
        )

    print('Cuda Mode is: {}\n'.format(args.cuda))

    if args.cuda:
        set_device()

    if args.model == 'mfcc':
        model = model_.cnn_lstm_mfcc(n_z=args.latent_size,
                                     proj_size=len(list(labels_dict.keys())),
                                     ncoef=args.ncoef,
                                     sm_type=args.softmax)
    elif args.model == 'fb':
        model = model_.cnn_lstm_fb(n_z=args.latent_size,
                                   proj_size=len(list(labels_dict.keys())),
                                   sm_type=args.softmax)
    elif args.model == 'resnet_fb':
        model = model_.ResNet_fb(n_z=args.latent_size,
                                 proj_size=len(list(labels_dict.keys())),
                                 sm_type=args.softmax)
    elif args.model == 'resnet_mfcc':
        model = model_.ResNet_mfcc(n_z=args.latent_size,
                                   proj_size=len(list(labels_dict.keys())),
                                   ncoef=args.ncoef,
                                   sm_type=args.softmax)
    elif args.model == 'resnet_lstm':
        model = model_.ResNet_lstm(n_z=args.latent_size,
                                   proj_size=len(list(labels_dict.keys())),
                                   ncoef=args.ncoef,
                                   sm_type=args.softmax)
示例#4
0
                    help='latent layer dimension (default: 200)')
parser.add_argument('--ncoef',
                    type=int,
                    default=13,
                    metavar='N',
                    help='number of MFCCs (default: 23)')
parser.add_argument('--pairwise',
                    action='store_true',
                    default=False,
                    help='Enables layer-wise comparison of norms')
args = parser.parse_args()

if args.model == 'mfcc':
    model = model_.cnn_lstm_mfcc(n_z=args.latent_size, ncoef=args.ncoef)
if args.model == 'fb':
    model = model_.cnn_lstm_fb(n_z=args.latent_size)
elif args.model == 'resnet_fb':
    model = model_.ResNet_fb(n_z=args.latent_size)
elif args.model == 'resnet_mfcc':
    model = model_.ResNet_mfcc(n_z=args.latent_size, ncoef=args.ncoef)
elif args.model == 'resnet_lstm':
    model = model_.ResNet_lstm(n_z=args.latent_size, ncoef=args.ncoef)
elif args.model == 'resnet_stats':
    model = model_.ResNet_stats(n_z=args.latent_size, ncoef=args.ncoef)
elif args.model == 'lcnn9_mfcc':
    model = model_.lcnn_9layers(n_z=args.latent_size, ncoef=args.ncoef)
elif args.model == 'lcnn29_mfcc':
    model = model_.lcnn_29layers_v2(n_z=args.latent_size, ncoef=args.ncoef)

if args.pairwise: