Beispiel #1
0

if __name__ == "__main__":

    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)
        elif args.dataset == 'sogou':
            x_train, x_test, t_train, t_test = dataset.hccr_onehot_sogou_64(
                n_y, sample_num)
Beispiel #2
0
    return encoder, lz_x,


if __name__ == "__main__":

    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)