if args.cuda: device = get_freer_gpu() if args.model_la == 'lstm': model_la = model_.cnn_lstm() elif args.model_la == 'resnet': model_la = model_.ResNet() elif args.model_la == 'resnet_pca': model_la = model_.ResNet_pca() elif args.model_la == 'lcnn_9': model_la = model_.lcnn_9layers() elif args.model_la == 'lcnn_29': model_la = model_.lcnn_29layers_v2() elif args.model_la == 'lcnn_9_pca': model_la = model_.lcnn_9layers_pca() elif args.model_la == 'lcnn_29_pca': model_la = model_.lcnn_29layers_v2_pca() elif args.model_la == 'lcnn_9_icqspec': model_la = model_.lcnn_9layers_icqspec() elif args.model_la == 'lcnn_9_prodspec': model_la = model_.lcnn_9layers_prodspec() elif args.model_la == 'lcnn_9_CC': model_la = model_.lcnn_9layers_CC(ncoef=args.ncoef_la) elif args.model_la == 'lcnn_29_CC': model_la = model_.lcnn_29layers_CC(ncoef=args.ncoef_la) elif args.model_la == 'resnet_CC': model_la = model_.ResNet_CC(ncoef=args.ncoef_la) if args.model_pa == 'lstm': model_pa = model_.cnn_lstm()
worker_init_fn=set_np_randomseed) else: valid_loader = None if args.model == 'lstm': model = model_.cnn_lstm(nclasses=args.n_classes) elif args.model == 'resnet': model = model_.ResNet(nclasses=args.n_classes) elif args.model == 'resnet_pca': model = model_.ResNet_pca(nclasses=args.n_classes) elif args.model == 'lcnn_9': model = model_.lcnn_9layers(nclasses=args.n_classes) elif args.model == 'lcnn_29': model = model_.lcnn_29layers_v2(nclasses=args.n_classes) elif args.model == 'lcnn_9_pca': model = model_.lcnn_9layers_pca(nclasses=args.n_classes) elif args.model == 'lcnn_29_pca': model = model_.lcnn_29layers_v2_pca(nclasses=args.n_classes) elif args.model == 'lcnn_9_icqspec': model = model_.lcnn_9layers_icqspec(nclasses=args.n_classes) elif args.model == 'lcnn_9_prodspec': model = model_.lcnn_9layers_prodspec(nclasses=args.n_classes) elif args.model == 'lcnn_9_CC': model = model_.lcnn_9layers_CC(nclasses=args.n_classes, ncoef=args.ncoef, init_coef=args.init_coef) elif args.model == 'lcnn_29_CC': model = model_.lcnn_29layers_CC(nclasses=args.n_classes, ncoef=args.ncoef, init_coef=args.init_coef) elif args.model == 'resnet_CC':
if args.cuda: device = get_freer_gpu() if args.model == 'lstm': model = model_.cnn_lstm() elif args.model == 'resnet': model = model_.ResNet() elif args.model == 'resnet_pca': model = model_.ResNet_pca() elif args.model == 'lcnn_9': model = model_.lcnn_9layers() elif args.model == 'lcnn_29': model = model_.lcnn_29layers_v2() elif args.model == 'lcnn_9_pca': model = model_.lcnn_9layers_pca() elif args.model == 'lcnn_29_pca': model = model_.lcnn_29layers_v2_pca() elif args.model == 'lcnn_9_icqspec': model = model_.lcnn_9layers_icqspec() elif args.model == 'lcnn_9_prodspec': model = model_.lcnn_9layers_prodspec() elif args.model == 'lcnn_9_CC': model = model_.lcnn_9layers_CC(ncoef=args.ncoef, init_coef=args.init_coef) elif args.model == 'lcnn_29_CC': model = model_.lcnn_29layers_CC(ncoef=args.ncoef, init_coef=args.init_coef) elif args.model == 'resnet_34_CC': model = model_.ResNet_34_CC(ncoef=args.ncoef, init_coef=args.init_coef)