Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MVCM
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
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
Show more breadcrumbs
Paolo Veglio
MVCM
Commits
4d7a3e42
Commit
4d7a3e42
authored
2 years ago
by
Paolo Veglio
Browse files
Options
Downloads
Patches
Plain Diff
fixed bug with conf_test where locut/hicut were reversed
parent
0d9d8c6f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
conf.py
+19
-9
19 additions, 9 deletions
conf.py
with
19 additions
and
9 deletions
conf.py
+
19
−
9
View file @
4d7a3e42
import
numpy
as
np
import
numpy
as
np
def
test
():
bt
=
np
.
arange
(
265
,
275
)
thr
=
np
.
array
([
267
,
270
,
273
,
1
,
1
])
c
=
conf_test
(
bt
,
thr
)
print
(
c
)
def
conf_test
(
rad
,
thr
):
def
conf_test
(
rad
,
thr
):
'''
'''
...
@@ -29,20 +35,20 @@ def conf_test(rad, thr):
...
@@ -29,20 +35,20 @@ def conf_test(rad, thr):
thr
=
np
.
full
((
rad
.
shape
[
0
],
4
),
thr
[:
4
]).
T
thr
=
np
.
full
((
rad
.
shape
[
0
],
4
),
thr
[:
4
]).
T
coeff
=
np
.
power
(
2
,
(
thr
[
3
]
-
1
))
coeff
=
np
.
power
(
2
,
(
thr
[
3
]
-
1
))
hicut
=
thr
[
0
,
:]
hicut
=
thr
[
2
,
:]
beta
=
thr
[
1
,
:]
beta
=
thr
[
1
,
:]
locut
=
thr
[
2
,
:]
locut
=
thr
[
0
,
:]
power
=
thr
[
3
,
:]
power
=
thr
[
3
,
:]
confidence
=
np
.
zeros
(
rad
.
shape
)
confidence
=
np
.
zeros
(
rad
.
shape
)
alpha
,
gamma
=
np
.
empty
(
rad
.
shape
),
np
.
empty
(
rad
.
shape
)
alpha
,
gamma
=
np
.
empty
(
rad
.
shape
),
np
.
empty
(
rad
.
shape
)
flipped
=
np
.
zeros
(
rad
.
shape
)
flipped
=
np
.
zeros
(
rad
.
shape
)
gamma
[
hicut
>
locut
]
=
thr
[
0
,
hicut
>
locut
]
gamma
[
hicut
>
locut
]
=
thr
[
2
,
hicut
>
locut
]
alpha
[
hicut
>
locut
]
=
thr
[
2
,
hicut
>
locut
]
alpha
[
hicut
>
locut
]
=
thr
[
0
,
hicut
>
locut
]
flipped
[
hicut
>
locut
]
=
0
flipped
[
hicut
>
locut
]
=
0
gamma
[
hicut
<
locut
]
=
thr
[
2
,
hicut
<
locut
]
gamma
[
hicut
<
locut
]
=
thr
[
0
,
hicut
<
locut
]
alpha
[
hicut
<
locut
]
=
thr
[
0
,
hicut
<
locut
]
alpha
[
hicut
<
locut
]
=
thr
[
2
,
hicut
<
locut
]
flipped
[
hicut
<
locut
]
=
1
flipped
[
hicut
<
locut
]
=
1
# Rad between alpha and beta
# Rad between alpha and beta
...
@@ -51,13 +57,13 @@ def conf_test(rad, thr):
...
@@ -51,13 +57,13 @@ def conf_test(rad, thr):
idx
=
np
.
nonzero
((
rad
<=
beta
)
&
(
flipped
==
0
))
idx
=
np
.
nonzero
((
rad
<=
beta
)
&
(
flipped
==
0
))
confidence
[
idx
]
=
coeff
[
idx
]
*
np
.
power
(
s1
[
idx
],
power
[
idx
])
confidence
[
idx
]
=
coeff
[
idx
]
*
np
.
power
(
s1
[
idx
],
power
[
idx
])
idx
=
np
.
nonzero
((
rad
<=
beta
)
&
(
flipped
==
1
))
idx
=
np
.
nonzero
((
rad
<=
beta
)
&
(
flipped
==
1
))
confidence
[
idx
]
=
coeff
[
idx
]
*
np
.
power
(
s1
[
idx
],
power
[
idx
])
confidence
[
idx
]
=
1.0
-
coeff
[
idx
]
*
np
.
power
(
s1
[
idx
],
power
[
idx
])
# Rad between beta and gamma
# Rad between beta and gamma
range_
=
2.
*
(
beta
-
gamma
)
range_
=
2.
*
(
beta
-
gamma
)
s1
=
(
rad
-
alph
a
)
/
range_
s1
=
(
rad
-
gamm
a
)
/
range_
idx
=
np
.
nonzero
((
rad
>
beta
)
&
(
flipped
==
0
))
idx
=
np
.
nonzero
((
rad
>
beta
)
&
(
flipped
==
0
))
confidence
[
idx
]
=
coeff
[
idx
]
*
np
.
power
(
s1
[
idx
],
power
[
idx
])
confidence
[
idx
]
=
1.0
-
coeff
[
idx
]
*
np
.
power
(
s1
[
idx
],
power
[
idx
])
idx
=
np
.
nonzero
((
rad
>
beta
)
&
(
flipped
==
1
))
idx
=
np
.
nonzero
((
rad
>
beta
)
&
(
flipped
==
1
))
confidence
[
idx
]
=
coeff
[
idx
]
*
np
.
power
(
s1
[
idx
],
power
[
idx
])
confidence
[
idx
]
=
coeff
[
idx
]
*
np
.
power
(
s1
[
idx
],
power
[
idx
])
...
@@ -176,3 +182,7 @@ def conf_test_dble(rad, coeffs):
...
@@ -176,3 +182,7 @@ def conf_test_dble(rad, coeffs):
confidence
[
confidence
<
0
]
=
0
confidence
[
confidence
<
0
]
=
0
return
confidence
return
confidence
if
__name__
==
"
__main__
"
:
test
()
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