Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TaggingBackends
Manage
Activity
Members
Labels
Plan
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
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
Show more breadcrumbs
Nyx
TaggingBackends
Commits
014b6021
Commit
014b6021
authored
2 years ago
by
François LAURENT
Browse files
Options
Downloads
Patches
Plain Diff
fixes #24
parent
ce46f805
No related branches found
No related tags found
No related merge requests found
Pipeline
#102072
passed
2 years ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/LarvaDatasets.jl
+4
-0
4 additions, 0 deletions
src/LarvaDatasets.jl
src/taggingbackends/data/dataset.py
+4
-0
4 additions, 0 deletions
src/taggingbackends/data/dataset.py
with
8 additions
and
0 deletions
src/LarvaDatasets.jl
+
4
−
0
View file @
014b6021
...
@@ -23,6 +23,7 @@ using HDF5
...
@@ -23,6 +23,7 @@ using HDF5
using
Dates
using
Dates
using
Statistics
using
Statistics
using
Memoization
using
Memoization
using
OrderedCollections
export
write_larva_dataset_hdf5
,
first_stimulus
,
labelcounts
export
write_larva_dataset_hdf5
,
first_stimulus
,
labelcounts
...
@@ -591,6 +592,9 @@ function write_larva_dataset_hdf5(output_dir::String,
...
@@ -591,6 +592,9 @@ function write_larva_dataset_hdf5(output_dir::String,
isnothing
(
sample_size
)
||
@error
"Argument sample_size not supported for the specified balancing strategy"
isnothing
(
sample_size
)
||
@error
"Argument sample_size not supported for the specified balancing strategy"
sample_sizes
,
total_sample_size
=
thresholdedcounts
(
counts
)
sample_sizes
,
total_sample_size
=
thresholdedcounts
(
counts
)
end
end
# ensure label order is preserved
sample_sizes
=
OrderedDict
((
label
=>
sample_sizes
[
label
])
for
label
in
labels
if
label
in
keys
(
sample_sizes
))
#
@info
"Sample sizes (observed, selected):"
[
Symbol
(
label
)
=>
(
get
(
counts
,
label
,
0
),
get
(
sample_sizes
,
label
,
0
))
for
label
in
labels
]
...
@info
"Sample sizes (observed, selected):"
[
Symbol
(
label
)
=>
(
get
(
counts
,
label
,
0
),
get
(
sample_sizes
,
label
,
0
))
for
label
in
labels
]
...
date
=
Dates
.
format
(
Dates
.
now
(),
"yyyy_mm_dd"
)
date
=
Dates
.
format
(
Dates
.
now
(),
"yyyy_mm_dd"
)
output_file
=
joinpath
(
output_dir
,
"larva_dataset_
$(date)
_
$(window_length)
_
$(window_length)
_
$(total_sample_size)
.hdf5"
)
output_file
=
joinpath
(
output_dir
,
"larva_dataset_
$(date)
_
$(window_length)
_
$(window_length)
_
$(total_sample_size)
.hdf5"
)
...
...
This diff is collapsed.
Click to expand it.
src/taggingbackends/data/dataset.py
+
4
−
0
View file @
014b6021
...
@@ -37,6 +37,10 @@ class LarvaDataset:
...
@@ -37,6 +37,10 @@ class LarvaDataset:
return
self
.
_full_set
return
self
.
_full_set
"""
"""
*list* of *bytes*: Set of distinct labels.
*list* of *bytes*: Set of distinct labels.
If the hdf5 file does not feature a top-level `labels` element that lists
the labels, the fallback labels and their order are:
RUN, BEND, STOP, HUNCH, BACK, ROLL.
"""
"""
@property
@property
def
labels
(
self
):
def
labels
(
self
):
...
...
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