Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Packages
signaturizer
Commits
e79bc2d0
Commit
e79bc2d0
authored
Feb 05, 2021
by
Martino Bertoni
🌋
Browse files
casting inputs to tensors
parent
78d7ea73
Changes
1
Hide whitespace changes
Inline
Side-by-side
signaturizer/signaturizer.py
View file @
e79bc2d0
...
...
@@ -194,7 +194,8 @@ class Signaturizer(object):
sign0s
.
append
(
calc_s0
)
# stack input fingerprints and run signature predictor
sign0s
=
np
.
vstack
(
sign0s
)
preds
=
self
.
model
.
predict
(
sign0s
,
batch_size
=
batch_size
)
preds
=
self
.
model
.
predict
(
tf
.
convert_to_tensor
(
sign0s
,
dtype
=
tf
.
float32
),
batch_size
=
batch_size
)
# add NaN where SMILES conversion failed
if
failed
:
preds
[
np
.
array
(
failed
)]
=
np
.
full
(
features
,
np
.
nan
)
...
...
@@ -203,7 +204,9 @@ class Signaturizer(object):
results
.
mfp
[
chunk
]
=
sign0s
# run applicability predictor
if
self
.
applicability
:
apreds
=
self
.
app_model
.
predict
(
sign0s
,
batch_size
=
batch_size
)
apreds
=
self
.
app_model
.
predict
(
tf
.
convert_to_tensor
(
sign0s
,
dtype
=
tf
.
float32
),
batch_size
=
batch_size
)
if
failed
:
apreds
[
np
.
array
(
failed
)]
=
np
.
nan
results
.
applicability
[
chunk
]
=
apreds
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment