Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
21_22-J 38
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
21_22-J 38
21_22-J 38
Commits
9ba1e301
Commit
9ba1e301
authored
Jan 03, 2022
by
W.D.R.P. Sandeepa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implemented get_data_splits function
parent
c6817b52
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
backend/IT18218640/train.py
backend/IT18218640/train.py
+16
-0
No files found.
backend/IT18218640/train.py
View file @
9ba1e301
...
@@ -12,6 +12,22 @@ BATCH_SIZE = 32
...
@@ -12,6 +12,22 @@ BATCH_SIZE = 32
NUM_KEYWORDS
=
10
NUM_KEYWORDS
=
10
def
get_data_splits
(
data_path
,
test_size
=
0.1
,
test_validation
=
0.1
):
# load dataset
X
,
y
=
load_dataset
(
data_path
)
# create train/validation/test splits
X_train
,
X_test
,
y_train
,
y_test
=
train_test_split
(
X
,
y
,
test_size
=
test_size
)
X_train
,
X_validation
,
y_train
,
y_validation
=
train_test_split
(
X_train
,
y_train
,
test_size
=
test_validation
)
# convert inputs from 2D TO 3D array
X_train
=
X_train
[
...
,
np
.
newaxis
]
X_validation
=
X_validation
[
...
,
np
.
newaxis
]
X_test
=
X_test
[
...
,
np
.
newaxis
]
return
X_train
,
X_validation
,
X_test
,
y_train
,
y_validation
,
y_test
def
build_model
(
input_shape
,
learning_rate
,
error
=
"sparse_categorical_crossentropy"
):
def
build_model
(
input_shape
,
learning_rate
,
error
=
"sparse_categorical_crossentropy"
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment