Ejemplo n.º 1
0
def extract_data(BATCH_SIZE,onehot = False):
    global content_index
    content_index = content_index + BATCH_SIZE
    if content_index>=70000:#202599
        content_index = 0

    lbl = _label[content_index:content_index+BATCH_SIZE]
    if onehot:
        lbl = ConvNet.onehot(10,lbl)

    return _data[content_index:content_index+BATCH_SIZE],lbl



    ###################
#     loadedimage = extract_data()
#     ConvNet.saveImagesMono(loadedimage, saveSize, "test0.png")
#     loadedimage = extract_data()
#     ConvNet.saveImagesMono(loadedimage, saveSize, "test1.png")
#     exit()

    
    
#     for idx in xrange(0, 1000000000):
#         loadedimage = extract_data()
#         global file_index
#         global content_index
#         print(str(file_index)+","+str(content_index))         
#     exit()

    ###################
    
Ejemplo n.º 2
0
def extract_traindata(BATCH_SIZE,onehot = False):
    global train_index
    train_index = train_index + BATCH_SIZE
    if train_index>=60000:#202599
        train_index = 0
    
    lbl = train_label[train_index:train_index+BATCH_SIZE]
    if onehot:
        lbl = ConvNet.onehot(10,lbl)
    return train_data[train_index:train_index+BATCH_SIZE],lbl
Ejemplo n.º 3
0
def extract_testdata(onehot = False):
    global test_index
    test_index = test_index + 1
    if test_index>=10000:#202599
        test_index = 0

    lbl = test_label[test_index:test_index+1]
    if onehot:
        lbl = ConvNet.onehot(10,lbl)

    return test_data[test_index:test_index+1],lbl