Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.learn.tensorflow
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
bob
bob.learn.tensorflow
Commits
17d1a879
There was a problem fetching the pipeline summary.
Commit
17d1a879
authored
7 years ago
by
Pavel KORSHUNOV
Browse files
Options
Downloads
Patches
Plain Diff
extending win slicing
parent
687d3298
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/learn/tensorflow/datashuffler/DiskAudio.py
+6
-2
6 additions, 2 deletions
bob/learn/tensorflow/datashuffler/DiskAudio.py
with
6 additions
and
2 deletions
bob/learn/tensorflow/datashuffler/DiskAudio.py
+
6
−
2
View file @
17d1a879
...
@@ -140,6 +140,9 @@ class DiskAudio(Base):
...
@@ -140,6 +140,9 @@ class DiskAudio(Base):
m_total_length
=
len
(
features
)
m_total_length
=
len
(
features
)
features_size
=
features
.
shape
[
1
]
features_size
=
features
.
shape
[
1
]
if
m_total_length
<
win_size
:
return
None
,
None
# compute the number of sliding windows
# compute the number of sliding windows
m_num_win
=
int
((
m_total_length
-
win_size
)
/
sliding_step
)
+
1
m_num_win
=
int
((
m_total_length
-
win_size
)
/
sliding_step
)
+
1
...
@@ -153,9 +156,10 @@ class DiskAudio(Base):
...
@@ -153,9 +156,10 @@ class DiskAudio(Base):
# the resulted shape is
# the resulted shape is
# (number of windows, window size, size of each feature vector)
# (number of windows, window size, size of each feature vector)
# we assume each value of features is 4 bytes
# we assume each value of features is 4 bytes
windows
=
stride_tricks
.
as_strided
(
features
,
windows
=
stride_tricks
.
as_strided
(
features
,
shape
=
(
m_num_win
,
win_size
,
features_size
),
shape
=
(
m_num_win
,
win_size
,
features_size
),
strides
=
(
features_size
*
4
,
features_size
*
4
,
4
))
strides
=
(
features_size
*
4
,
features_size
*
4
,
4
))
# make sure the array is divided into equal chunks
# make sure the array is divided into equal chunks
#windows = numpy.split(features[:int(win_size) * int(m_num_win)], int(m_num_win))
#windows = numpy.split(features[:int(win_size) * int(m_num_win)], int(m_num_win))
...
...
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