Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OrcaSong
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Machine Learning
OrcaSong
Commits
770d8a8d
Commit
770d8a8d
authored
3 years ago
by
Stefan Reck
Browse files
Options
Downloads
Patches
Plain Diff
add option to FileGraph to use only triggered hits
parent
e028637d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
orcasong/core.py
+7
-1
7 additions, 1 deletion
orcasong/core.py
orcasong/modules.py
+5
-0
5 additions, 0 deletions
orcasong/modules.py
with
12 additions
and
1 deletion
orcasong/core.py
+
7
−
1
View file @
770d8a8d
...
...
@@ -367,6 +367,8 @@ class FileGraph(BaseProcessor):
hit_infos : tuple, optional
Which entries in the
'
/Hits
'
Table will be kept. E.g. pos_x, time, ...
Default: Keep all entries.
only_triggered_hits : bool
If true, use only triggered hits. Otherwise, use all hits.
kwargs
Options of the BaseProcessor.
...
...
@@ -374,10 +376,12 @@ class FileGraph(BaseProcessor):
def
__init__
(
self
,
max_n_hits
,
time_window
=
None
,
hit_infos
=
None
,
only_triggered_hits
=
False
,
**
kwargs
):
self
.
max_n_hits
=
max_n_hits
self
.
time_window
=
time_window
self
.
hit_infos
=
hit_infos
self
.
only_triggered_hits
=
only_triggered_hits
super
().
__init__
(
**
kwargs
)
def
get_cmpts_main
(
self
):
...
...
@@ -385,7 +389,9 @@ class FileGraph(BaseProcessor):
"
max_n_hits
"
:
self
.
max_n_hits
,
"
time_window
"
:
self
.
time_window
,
"
hit_infos
"
:
self
.
hit_infos
,
"
dset_n_hits
"
:
"
EventInfo
"
}))]
"
dset_n_hits
"
:
"
EventInfo
"
,
"
only_triggered_hits
"
:
self
.
only_triggered_hits
,
}))]
def
finish_file
(
self
,
f
,
summary
):
super
().
finish_file
(
f
,
summary
)
...
...
This diff is collapsed.
Click to expand it.
orcasong/modules.py
+
5
−
0
View file @
770d8a8d
...
...
@@ -287,6 +287,8 @@ class PointMaker(kp.Module):
If given, store the number of hits that are in the time window
as a new column called
'
n_hits_intime
'
in the dataset with
this name (usually this is EventInfo).
only_triggered_hits : bool
If true, use only triggered hits. Otherwise, use all hits.
"""
def
configure
(
self
):
...
...
@@ -294,6 +296,7 @@ class PointMaker(kp.Module):
self
.
hit_infos
=
self
.
get
(
"
hit_infos
"
,
default
=
None
)
self
.
time_window
=
self
.
get
(
"
time_window
"
,
default
=
None
)
self
.
dset_n_hits
=
self
.
get
(
"
dset_n_hits
"
,
default
=
None
)
self
.
only_triggered_hits
=
self
.
get
(
"
only_triggered_hits
"
,
default
=
False
)
self
.
store_as
=
"
samples
"
def
process
(
self
,
blob
):
...
...
@@ -326,6 +329,8 @@ class PointMaker(kp.Module):
(
self
.
max_n_hits
,
len
(
self
.
hit_infos
)
+
1
),
dtype
=
"
float32
"
)
hits
=
blob
[
"
Hits
"
]
if
self
.
only_triggered_hits
:
hits
=
hits
[
hits
.
triggered
!=
0
]
if
self
.
time_window
is
not
None
:
# remove hits outside of time window
hits
=
hits
[
np
.
logical_and
(
...
...
This diff is collapsed.
Click to expand it.
Stefan Reck
@sreck
mentioned in issue
#22
·
3 years ago
mentioned in issue
#22
mentioned in issue #22
Toggle commit list
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