Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
baseLess
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
Lannoy, Carlos de
baseLess
Commits
c188067d
Commit
c188067d
authored
3 years ago
by
Noordijk, Ben
Browse files
Options
Downloads
Patches
Plain Diff
Updated docstring and decreased step size
parent
959894f8
No related branches found
Branches containing commit
No related tags found
1 merge request
!5
compare_accuracy.py now saves confusion matrices and can be called on the...
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
nns/Cnn_test.py
+3
-4
3 additions, 4 deletions
nns/Cnn_test.py
with
3 additions
and
4 deletions
nns/Cnn_test.py
+
3
−
4
View file @
c188067d
...
...
@@ -127,16 +127,16 @@ class NeuralNetwork(object):
def
predict
(
self
,
x
,
clean_signal
=
True
,
return_probs
=
False
):
"""
Given sequences input as x, predict if they contain target k-mer.
Assumes that read is already split up into smaller batches.
Assumes the sequence x is a read that has been normalised,
but not cut into smaller chunks
:param x: Squiggle as numeric representation
:type x: np.ndarray
:param clean_signal:
:param return_probs:
:return: unnormalized predicted values
:rtype: np.array of posteriors
"""
offset
=
self
.
filter_width
//
4
offset
=
self
.
filter_width
//
5
ho
=
offset
//
2
lb
,
rb
=
self
.
hfw
-
ho
,
self
.
hfw
+
ho
+
1
idx
=
np
.
arange
(
self
.
filter_width
,
len
(
x
)
+
offset
,
offset
)
...
...
@@ -147,7 +147,6 @@ class NeuralNetwork(object):
truncating
=
'
post
'
,
dtype
=
'
float32
'
),
-
1
)
# Put predicted class = 1 where posterior is larger than threshold
posteriors
=
self
.
model
.
predict
(
x_pad
)
y_hat
=
posteriors
>
self
.
threshold
y_out
=
np
.
zeros
(
len
(
x
),
dtype
=
int
)
...
...
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