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__': if __name__ == '__main__':
#%% #%%
import numpy as np import numpy as np
...@@ -123,23 +124,32 @@ if __name__ == '__main__': ...@@ -123,23 +124,32 @@ if __name__ == '__main__':
i += 1 i += 1
index +=1 index +=1
#XTrain.resize(XTrain.shape[0]+trainChunk, axis=0) trainChunk = len(xTrain)
#XTrain[-trainChunk:] = xTrain if trainChunk != 0:
#YTrain.resize(YTrain.shape[0]+trainChunk, axis=0) XTrain.resize(XTrain.shape[0]+trainChunk, axis=0)
#YTrain[-trainChunk:] = yTrain XTrain[-trainChunk:] = xTrain
#XVal.resize(XVal.shape[0]+valTestChunk, axis=0) YTrain.resize(YTrain.shape[0]+trainChunk, axis=0)
#XVal[-valTestChunk:] = xVal YTrain[-trainChunk:] = yTrain
#YVal.resize(YVal.shape[0]+valTestChunk, axis=0) valTestChunk = len(xVal)
#YVal[-valTestChunk:] = yVal if valTestChunk != 0:
#XTest.resize(XTest.shape[0]+valTestChunk, axis=0) XVal.resize(XVal.shape[0]+valTestChunk, axis=0)
#XTest[-valTestChunk:] = xTest XVal[-valTestChunk:] = xVal
#YTest.resize(YTest.shape[0]+valTestChunk, axis=0) YVal.resize(YVal.shape[0]+valTestChunk, axis=0)
#YTest[-valTestChunk:] = yTest 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 import h5py
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment