def LoadData():
    mdr = MnistImageDataReader("vector")
    mdr.ReadLessData(1000)
    mdr.NormalizeX()
    mdr.NormalizeY(NetType.MultipleClassifier, base=0)
    mdr.GenerateValidationSet(k=10)
    return mdr
Example #2
0
def load_data():
    dataReader = MnistImageDataReader(mode="timestep")
    dataReader.ReadLessData(10000)
    dataReader.NormalizeX()
    dataReader.NormalizeY(NetType.MultipleClassifier, base=0)
    dataReader.Shuffle()
    dataReader.GenerateValidationSet(k=12)
    return dataReader
def GenerateDataSet(subfolder, count=10):
    isExists = os.path.exists(subfolder)
    if not isExists:
        os.makedirs(subfolder)

    mdr = MnistImageDataReader("vector")
    mdr.ReadLessData(1000)

    for i in range(count):
        X = np.zeros_like(mdr.XTrainRaw)
        Y = np.zeros_like(mdr.YTrainRaw)
        list = np.random.choice(1000, 1000)
        k = 0
        for j in list:
            X[k] = mdr.XTrainRaw[j]
            Y[k] = mdr.YTrainRaw[j]
            k = k + 1
        # end for
        np.savez(subfolder + "/" + str(i) + ".npz", data=X, label=Y)
def LoadData():
    mdr = MnistImageDataReader("image")
    mdr.ReadLessData(1000)
    mdr.NormalizeX()
    return mdr