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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
w2v
w2v
Commits
c09ded41
Commit
c09ded41
authored
3 years ago
by
Silas Dohm
Browse files
Options
Downloads
Patches
Plain Diff
fixed earlystop
parent
5153a47f
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
python/w2v_cnn_gen_hdf5.py
+1
-1
1 addition, 1 deletion
python/w2v_cnn_gen_hdf5.py
python/w2v_sentence_mean gen.py
+1
-1
1 addition, 1 deletion
python/w2v_sentence_mean gen.py
python/w2v_sentence_mean.py
+1
-1
1 addition, 1 deletion
python/w2v_sentence_mean.py
with
3 additions
and
3 deletions
python/w2v_cnn_gen_hdf5.py
+
1
−
1
View file @
c09ded41
...
...
@@ -28,7 +28,7 @@ num_rows = 4.8E6
batchSize
=
2048
steps
=
num_rows
/
batchSize
#early stop
earlystop
=
keras
.
callbacks
.
EarlyStopping
(
monitor
=
'
sparse_categorical_accuracy
'
,
patience
=
10
,
verbose
=
False
,
restore_best_weights
=
True
)
earlystop
=
keras
.
callbacks
.
EarlyStopping
(
monitor
=
'
val_
sparse_categorical_accuracy
'
,
patience
=
5
,
verbose
=
False
,
restore_best_weights
=
True
)
cbList
=
[
earlystop
]
trainData
=
hdf5Generator
(
path
+
"
w2vCNN.hdf5
"
,
batchSize
,
"
Train
"
)
...
...
This diff is collapsed.
Click to expand it.
python/w2v_sentence_mean gen.py
+
1
−
1
View file @
c09ded41
...
...
@@ -72,7 +72,7 @@ modelNN.compile(optimizer='adam',loss='categorical_crossentropy',metrics=["spars
# %% fit
#early stop
earlystop
=
keras
.
callbacks
.
EarlyStopping
(
monitor
=
'
sparse_categorical_accuracy
'
,
patience
=
10
,
verbose
=
False
,
restore_best_weights
=
True
)
earlystop
=
keras
.
callbacks
.
EarlyStopping
(
monitor
=
'
val_
sparse_categorical_accuracy
'
,
patience
=
10
,
verbose
=
False
,
restore_best_weights
=
True
)
cbList
=
[
earlystop
]
train
=
generate_arrays_from_file
(
'
./train.json
'
,
batchSize
)
...
...
This diff is collapsed.
Click to expand it.
python/w2v_sentence_mean.py
+
1
−
1
View file @
c09ded41
...
...
@@ -64,7 +64,7 @@ modelNN.compile(optimizer='adam',loss='sparse_categorical_crossentropy',metrics=
# %% fit
#early stop
earlystop
=
keras
.
callbacks
.
EarlyStopping
(
monitor
=
'
sparse_categorical_accuracy
'
,
patience
=
5
,
verbose
=
False
,
restore_best_weights
=
True
)
earlystop
=
keras
.
callbacks
.
EarlyStopping
(
monitor
=
'
val_
sparse_categorical_accuracy
'
,
patience
=
5
,
verbose
=
False
,
restore_best_weights
=
True
)
cbList
=
[
earlystop
]
count
=
np
.
unique
(
Y_train
,
return_counts
=
True
)[
1
]
cWeight
=
1
/
(
count
/
Y_train
.
size
)
...
...
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