Example #1
0
 casia_offline_reverse = 10
 tf.set_random_seed(1234)
 np.random.seed(1234)
 if not args.code:
     if args.dataset == 'hand':
         x_train, x_test, t_train, t_test = dataset.hccr_onehot_hand_64(
             n_y, sample_num)
         t_train,t_test = \
             utils.to_onehot(t_train, n_y), utils.to_onehot(t_test, n_y)
     elif args.dataset == 'standard':
         x_train, x_test, t_train, t_test = dataset.hccr_onehot_standard_64(
             n_y, sample_num)
         t_train, t_test = \
             utils.to_onehot(t_train, n_y), utils.to_onehot(t_test, n_y)
     elif args.dataset == 'casia-online':
         x_train, x_test, t_train, t_test = dataset.hccr_onehot_casia_online_64(
             n_y, sample_num)
         t_train, t_test = \
             utils.to_onehot(t_train, n_y), utils.to_onehot(t_test, n_y)
     elif args.dataset == 'casia-offline':
         x_train, x_test, t_train, t_test = dataset.hccr_onehot_casia_offline_64(
             n_y, sample_num)
         t_train, t_test = \
             utils.to_onehot(t_train, n_y), utils.to_onehot(t_test, n_y)
     elif args.dataset == 'sogou':
         x_train, x_test, t_train, t_test = dataset.hccr_onehot_sogou_64(
             n_y, sample_num)
         t_train, t_test = \
             utils.to_onehot(t_train, n_y), utils.to_onehot(t_test, n_y)
     elif args.dataset == 'fusion':
         x_train_s, x_test_s, t_train_s, t_test_s = dataset.hccr_onehot_standard_64(
             ny, sample_num, train_test_rate=train_test_rate)
Example #2
0
    casia_online = 10
    casia_offline_reverse = 10
    tf.set_random_seed(1234)
    np.random.seed(1234)
    if not args.code:
        if args.dataset == 'hand':
            x_train, x_test, t_train,  t_test = dataset.hccr_onehot_hand_64(n_y, sample_num)
            t_train,t_test = \
                utils.to_onehot(t_train, n_y), utils.to_onehot(t_test, n_y)
        elif args.dataset == 'standard':
            x_train, x_test, t_train, t_test = dataset.hccr_onehot_standard_64(n_y, sample_num)
            t_train, t_test = \
                utils.to_onehot(t_train, n_y), utils.to_onehot(t_test, n_y)
        elif args.dataset == 'casia-online':
            x_train, x_test, t_train, t_test = dataset.hccr_onehot_casia_online_64(n_y, sample_num)
            t_train, t_test = \
                utils.to_onehot(t_train, n_y), utils.to_onehot(t_test, n_y)
        elif args.dataset == 'casia-offline':
            x_train, x_test, t_train, t_test = dataset.hccr_onehot_casia_offline_64(n_y, sample_num)
            t_train, t_test = \
                utils.to_onehot(t_train, n_y), utils.to_onehot(t_test, n_y)
        else:
            raise ValueError('Only have dataset: hand, standard, casia')
    else:
        if args.dataset == 'hand':
            x_train, x_test, t_train, t_test, n_code = dataset.hccr_code_hand_64(n_y, sample_num)
        elif args.dataset == 'standard':
            x_train, x_test, t_train, t_test, n_code = dataset.hccr_code_standard_64(n_y, sample_num , train_test_rate=train_test_rate)
        elif args.dataset == 'casia-online':
            x_train, x_test, t_train, t_test, n_code = dataset.hccr_code_casia_online_64(n_y, sample_num, train_test_rate=train_test_rate)