Commit e79bc2d0 authored by Martino Bertoni's avatar Martino Bertoni 🌋
Browse files

casting inputs to tensors

parent 78d7ea73
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment