Skip to content

Commit

Permalink
Fixed reshape error for invalid smiles (#229)
Browse files Browse the repository at this point in the history
* fixed reshape error for invalid smiles

* fixed parallel issue with ind_preds variable
  • Loading branch information
eyalmazuz committed Jan 21, 2022
1 parent cf420db commit 1e264cc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions chemprop/train/make_predictions.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,10 @@ def predict_and_save(args: PredictArgs, train_args: TrainArgs, test_data: Molecu

# Reshape multiclass to merge task and class dimension, with updated num_tasks
if args.dataset_type == 'multiclass':
preds = preds.reshape((num_tasks))
if args.ensemble_variance or args. individual_ensemble_predictions:
ind_preds = ind_preds.reshape((num_tasks, len(args.checkpoint_paths)))
if isinstance(preds, np.ndarray) and preds.ndim > 1:
preds = preds.reshape((num_tasks))
if args.ensemble_variance or args. individual_ensemble_predictions:
ind_preds = ind_preds.reshape((num_tasks, len(args.checkpoint_paths)))

# If extra columns have been dropped, add back in SMILES columns
if args.drop_extra_columns:
Expand Down

0 comments on commit 1e264cc

Please sign in to comment.