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
15fe5cf0
Commit
15fe5cf0
authored
3 years ago
by
Gijs vermariën
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'origin/master' into triggered_hits
parents
2f61ad45
7efe0a81
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
docs/conf.py
+1
-1
1 addition, 1 deletion
docs/conf.py
orcasong/core.py
+15
-15
15 additions, 15 deletions
orcasong/core.py
orcasong/modules.py
+5
-0
5 additions, 0 deletions
orcasong/modules.py
with
21 additions
and
16 deletions
docs/conf.py
+
1
−
1
View file @
15fe5cf0
...
...
@@ -219,4 +219,4 @@ todo_include_todos = True
def
setup
(
app
):
app
.
add_
stylesheet
(
'
_static/style.css
'
)
app
.
add_
css_file
(
'
_static/style.css
'
)
This diff is collapsed.
Click to expand it.
orcasong/core.py
+
15
−
15
View file @
15fe5cf0
...
...
@@ -398,31 +398,31 @@ 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.
"""
def
__init__
(
self
,
max_n_hits
,
time_window
=
None
,
hit_infos
=
None
,
**
kwargs
):
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
):
return
[
(
(
modules
.
PointMaker
,
{
"
max_n_hits
"
:
self
.
max_n_hits
,
"
time_window
"
:
self
.
time_window
,
"
hit_infos
"
:
self
.
hit_infos
,
"
dset_n_hits
"
:
"
EventInfo
"
,
},
)
)
]
return
[((
modules
.
PointMaker
,
{
"
max_n_hits
"
:
self
.
max_n_hits
,
"
time_window
"
:
self
.
time_window
,
"
hit_infos
"
:
self
.
hit_infos
,
"
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 @
15fe5cf0
...
...
@@ -288,6 +288,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.
"""
...
...
@@ -296,6 +298,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
):
...
...
@@ -329,6 +332,8 @@ class PointMaker(kp.Module):
points
=
np
.
zeros
((
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
[
...
...
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