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
chemical_checker
Commits
d65a1b13
Commit
d65a1b13
authored
Dec 03, 2021
by
Martino Bertoni
🌋
Browse files
A1 sign0 must be reordered also at sign4 predict time
parent
56934832
Pipeline
#2585
failed with stages
in 15 minutes and 23 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
package/chemicalchecker/core/sign4.py
View file @
d65a1b13
...
...
@@ -277,15 +277,16 @@ class sign4(BaseSignature, DataSignature):
results
.
create_dataset
(
'V'
,
(
len
(
sign0
.
keys
),
128
),
dtype
=
np
.
float32
)
results
.
create_dataset
(
"shape"
,
data
=
(
len
(
sign0
.
keys
),
128
))
for
i
in
tqdm
(
range
(
0
,
len
(
sign0
.
keys
),
chunk_size
)):
chunk
=
slice
(
i
,
i
+
chunk_size
)
sign0s
=
sign0
[
chunk
]
preds
=
predict_fn
(
sign0s
)
# sign0 must be reordered
order
=
np
.
argsort
(
sign0
.
get_h5_dataset
(
'features'
).
astype
(
int
))
cs
=
chunk_size
for
chunk
,
rows
in
sign0
.
chunk_iter
(
'V'
,
cs
,
axis
=
0
,
chunk
=
True
):
rows
=
rows
[:,
order
]
preds
=
predict_fn
(
rows
)
# save chunk to H5
results
[
'V'
][
chunk
]
=
preds
[:]
# also run applicability prediction
apreds
=
appl_fn
(
sign0
s
)
apreds
=
appl_fn
(
row
s
)
results
[
'applicability'
][
chunk
]
=
apreds
[:]
return
pred_s3
...
...
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