morgancthomas / smiles-rnn Goto Github PK
View Code? Open in Web Editor NEWRepository for SMILES-based RNNs for reinforcement learning-based de novo molecule generation
License: MIT License
Repository for SMILES-based RNNs for reinforcement learning-based de novo molecule generation
License: MIT License
In the course of other work, I see that I made the following changes locally in train_prior.py. Would this be a good change to include?
- required.add_argument('-i', '--train_smiles', type=str, help='Path to smiles file')
- required.add_argument('-o', '--output_directory', type=str, help='Output directory to save model')
- required.add_argument('-s', '--suffix', type=str, help='Suffix to name files')
+ required.add_argument('-i', '--train_smiles', type=str, help='Path to smiles file', required=True)
+ required.add_argument('-o', '--output_directory', type=str, help='Output directory to save model', required=True)
+ required.add_argument('-s', '--suffix', type=str, help='Suffix to name files', required=True)
In the model files (rnn.py, transformer.py and gated_transformer.py), there is a mistake on a line causing an error:
UnboundLocalError: local variable 'input_vector' referenced before assignment
I think
input_vector = input_vector.to(self.device)
should be
input_vectors = input_vectors.to(self.device)
Hi,
Running the reinforcement_learning.py code, the following error occurred.
(molscore) medicina@medicina:SMILES-RNN$ python reinforcement_learning.py -p Prior_GuacaMol_reprod_lstm_Epoch-10.ckpt -m ret_sim_config.json --model RNN RV2
Found existing directory, appending current time to distinguish
Device set to cuda
0%| | 0/250 [00:00<?, ?it/s]
Traceback (most recent call last):
File "/media/medicina/SMILES-RNN/model/RL.py", line 84, in _score
scores = self.scoring_function(smiles)
File "/media/medicina/SMILES-RNN/molscore/manager.py", line 586, in call
self.run_scoring_functions(smiles=smiles_to_process, file_names=file_names)
File "/media/medicina/SMILES-RNN/molscore/manager.py", line 248, in run_scoring_functions
results = function(smiles=smiles, directory=self.save_dir, file_names=file_names)
File "/media/medicina/SMILES-RNN/molscore/scoring_functions/similarity.py", line 102, in call
with Pool(self.n_jobs) as pool:
File "/home/medicina/anaconda3/envs/molscore/lib/python3.6/multiprocessing/context.py", line 119, in Pool
context=self.get_context())
File "/home/medicina/anaconda3/envs/molscore/lib/python3.6/multiprocessing/pool.py", line 174, in init
self._repopulate_pool()
File "/home/medicina/anaconda3/envs/molscore/lib/python3.6/multiprocessing/pool.py", line 229, in _repopulate_pool
for i in range(self._processes - len(self._pool)):
TypeError: 'float' object cannot be interpreted as an integer
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "reinforcement_learning.py", line 157, in
main(args)
File "reinforcement_learning.py", line 49, in main
record = RL.train(n_steps=args.n_steps, save_freq=args.save_freq)
File "/media/medicina/SMILES-RNN/model/RL.py", line 50, in train
self._train_step(step=step)
File "/media/medicina/SMILES-RNN/model/RL.py", line 187, in _train_step
scores = self._score(smiles, step)
File "/media/medicina/SMILES-RNN/model/RL.py", line 93, in _score
self.scoring_function.write_scores()
File "/media/medicina/SMILES-RNN/molscore/manager.py", line 415, in write_scores
temp = self.main_df.copy()
AttributeError: 'NoneType' object has no attribute 'copy'
What kind of error is this? Please help.
Thanks
In the script script/train_prior.py
, it crashes when writing the training times to the json
file
Thanks for the code!
We would like to run this on an A100, however, on the Ampere cards, it requires CUDA SDK or toolkit to be v11.0<. However, this is pinned in environment.yml
with cudatoolkit=10.2.89
.
Is there a chance this could be updated for the latest cards?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.