Skip to content
Snippets Groups Projects
Commit 379a3ae7 authored by Joel Vongehr's avatar Joel Vongehr
Browse files

now saves the last batch of data without crashing

parent 06ea5ba6
No related branches found
No related tags found
No related merge requests found
from gensim.utils import chunkize
if __name__ == '__main__':
#%%
import numpy as np
......@@ -123,23 +124,32 @@ if __name__ == '__main__':
i += 1
index +=1
#XTrain.resize(XTrain.shape[0]+trainChunk, axis=0)
#XTrain[-trainChunk:] = xTrain
trainChunk = len(xTrain)
if trainChunk != 0:
#YTrain.resize(YTrain.shape[0]+trainChunk, axis=0)
#YTrain[-trainChunk:] = yTrain
XTrain.resize(XTrain.shape[0]+trainChunk, axis=0)
XTrain[-trainChunk:] = xTrain
#XVal.resize(XVal.shape[0]+valTestChunk, axis=0)
#XVal[-valTestChunk:] = xVal
YTrain.resize(YTrain.shape[0]+trainChunk, axis=0)
YTrain[-trainChunk:] = yTrain
#YVal.resize(YVal.shape[0]+valTestChunk, axis=0)
#YVal[-valTestChunk:] = yVal
valTestChunk = len(xVal)
if valTestChunk != 0:
#XTest.resize(XTest.shape[0]+valTestChunk, axis=0)
#XTest[-valTestChunk:] = xTest
XVal.resize(XVal.shape[0]+valTestChunk, axis=0)
XVal[-valTestChunk:] = xVal
#YTest.resize(YTest.shape[0]+valTestChunk, axis=0)
#YTest[-valTestChunk:] = yTest
YVal.resize(YVal.shape[0]+valTestChunk, axis=0)
YVal[-valTestChunk:] = yVal
valTestChunk = len(xTest)
if valTestChunk != 0:
XTest.resize(XTest.shape[0]+valTestChunk, axis=0)
XTest[-valTestChunk:] = xTest
YTest.resize(YTest.shape[0]+valTestChunk, axis=0)
YTest[-valTestChunk:] = yTest
#%%
import h5py
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment