Exemplo n.º 1
0
def loadNeuData(opts):
    print('loading data...')
    x_day_dir = opts.input
    #train_x, train_y, val_x, val_y, test_x, test_y = readSigmf.getData(opts, x_day_dir)
    dataOpts = load_slice_IQ.loadDataOpts(opts.input, opts.location, opts.D2, num_slice=100000)
    train_x, train_y, test_x, test_y, NUM_CLASS = load_slice_IQ.loadData(dataOpts, opts.channel_first)

    if opts.normalize:
        train_x = load_slice_IQ.normalizeData(train_x)
        test_x = load_slice_IQ.normalizeData(test_x)

    return train_x, train_y, test_x, test_y, NUM_CLASS
Exemplo n.º 2
0
def loadData2Dict(opts):
    print('loading data...')
    # train_x, train_y, val_x, val_y, test_x, test_y = readSigmf.getData(opts, x_day_dir)
    # D2 means that make it into 2 dimension data
    dataOpts = load_slice_IQ.loadDataOpts(opts.input, opts.location, opts.D2, num_slice=10000)
    train_x, train_y, test_x, test_y, NUM_CLASS = load_slice_IQ.loadData(dataOpts, opts.channel_first)

    if opts.normalize:
        train_x = load_slice_IQ.normalizeData(train_x)
        test_x = load_slice_IQ.normalizeData(test_x)

    data_dict = {}
    data_dict['x_train'] = train_x
    data_dict['y_train'] = train_y
    data_dict['x_test'] = test_x
    data_dict['y_test'] = test_y

    print('x_train shape: {}\ty_train shape: {}\tx_test shape: {}\ty_test shape: {}'.format(train_x.shape, train_y.shape, test_x.shape, test_y.shape))

    return data_dict