Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JOSS] Examples #8

Closed
RMeli opened this issue Jun 23, 2023 · 4 comments
Closed

[JOSS] Examples #8

RMeli opened this issue Jun 23, 2023 · 4 comments

Comments

@RMeli
Copy link

RMeli commented Jun 23, 2023

Running analysis_example.py in the examples/ folder results in the following error:

FileNotFoundError: [Errno 2] No such file or directory: 'xbb_foldingnet_checkpoints\\checkpoint_no_optimizer_state_dict_epoch167_loss0.003259085263643.ckpt'

This happens similarly for the following paths:

data.import_pdb('data\\MurD_closed_selection.pdb')
data.import_pdb('data\\MurD_open_selection.pdb')

I'd suggest to use os.path.join to concatenate paths.


openjournals/joss-reviews#5523

@RMeli
Copy link
Author

RMeli commented Jun 23, 2023

This is a bonus and not required at all for JOSS, but would it be possible to add a plotting output for the analysis script?

print("> generating error landscape")
# build a 50x50 grid. By default, it will be 10% larger than the region occupied
# by all loaded datasets
MA.setup_grid(50)
landscape_err_latent, landscape_err_3d, xaxis, yaxis = MA.scan_error()
## to visualise the GUI, execute the code above in a Jupyter notebook, then call:
# from molearn.analysis import MolearnGUI
# MolearnGUI(MA)

The "generating error landscape" phase takes some time so the suspense runs high and it's a bit deceiving not to get any output. =)

@RMeli
Copy link
Author

RMeli commented Jun 23, 2023

When running bb_example_subclassing_trainer.py I get the following error:

Traceback (most recent call last):
  File "/home/rmeli/git/molearn/examples/bb_example_subclassing_trainer.py", line 127, in <module>
    trainer.run(max_epochs = 32+trainer.epoch,**runkwargs)
  File "/home/rmeli/git/molearn/src/molearn/trainers/trainer.py", line 181, in run
    logs.update(self.valid_epoch(epoch))
                ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/rmeli/git/molearn/examples/bb_example_subclassing_trainer.py", line 87, in valid_epoch
    results['valid_DOPE'] = dope[:,0].mean()
                            ~~~~^^^^^
IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed

Printing the shape of dope I get (8,).

@SCMusson
Copy link
Collaborator

SCMusson commented Jun 28, 2023

I apologise for the delayed reply.

commit ceff082 should add os.sep to file names in analysis_example.py. This was simply a mistake on our part.

commit 9ccea59 should add some simple plots. I agree it's a bit disappointing to run the script and get nothing at the end.

commit 68f788c should fix bb_example_subclassing_trainer.py this is a simple bug due to the default behaviour of refine=True changing and this script not being updated to reflect that change. Previously the returned array would have been of shape [n, 2] where dope[:, 0] would be unrefined dope scores and dope[:, 1] would be refined dope scores. While the new behaviour returns an array of shape [n,] with only the refined structures. I have updated the script to use the old behaviour by passing refine = 'both'.

@RMeli
Copy link
Author

RMeli commented Jun 29, 2023

Thank you @SCMusson for fixing the few issues and for adding some simple plots, everything seems to work well now.

To avoid this kind of problems in the future (example scripts not following the changes in the code base), it might be worth thinking of testing them in CI (maybe only a few training step with a reduced model and data set).

@RMeli RMeli closed this as completed Jun 29, 2023
@RMeli RMeli mentioned this issue Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants