Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
w2v
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
w2v
w2v
Commits
379a3ae7
Commit
379a3ae7
authored
Aug 2, 2021
by
Joel Vongehr
Browse files
Options
Downloads
Patches
Plain Diff
now saves the last batch of data without crashing
parent
06ea5ba6
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
python/hdf5.py
+22
-12
22 additions, 12 deletions
python/hdf5.py
with
22 additions
and
12 deletions
python/hdf5.py
+
22
−
12
View file @
379a3ae7
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
:
#Y
Train.resize(
Y
Train.shape[0]+trainChunk, axis=0)
X
Train
.
resize
(
X
Train
.
shape
[
0
]
+
trainChunk
,
axis
=
0
)
#Y
Train[-trainChunk:] =
y
Train
X
Train
[
-
trainChunk
:]
=
x
Train
#XVal
.resize(
XVal
.shape[0]+
valTest
Chunk, axis=0)
YTrain
.
resize
(
YTrain
.
shape
[
0
]
+
train
Chunk
,
axis
=
0
)
#XVal[-valTest
Chunk:] =
xVal
YTrain
[
-
train
Chunk
:]
=
yTrain
#YVal.resize(YVal.shape[0]+
valTestChunk
, axis=0
)
valTestChunk
=
len
(
xVal
)
#YVal[-
valTestChunk
:] = yVal
if
valTestChunk
!=
0
:
#XTest
.resize(X
Test
.shape[0]+valTestChunk, axis=0)
XVal
.
resize
(
X
Val
.
shape
[
0
]
+
valTestChunk
,
axis
=
0
)
#XTest
[-valTestChunk:] = x
Test
XVal
[
-
valTestChunk
:]
=
x
Val
#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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment