Coder Social home page Coder Social logo

cvae's Introduction

Screenshot

github for "Molecular generative model based on conditional variational autoencoder for de novo molecular design"

https://jcheminf.biomedcentral.com/articles/10.1186/s13321-018-0286-7

https://arxiv.org/abs/1806.05805

  1. Fisrt, you need to prepare file containing smiles. each line of the file is smiles of a molecule (please see smiles.txt in this repo)
  2. Calculate properties of molecules using following command
python cal_prop.py --input_filename=smiles.txt --output_filename=smiles_prop.txt
  1. You can train a model using following command
python -u train.py --prop_file=smiles_prop.txt --save_dir=./save
  1. After trining a model, you can generate molecules with desirable properties. Suppose you want to generate molecules whoe MW=300, LogP=4, and TPSA=100, then the command is following:
python sample.py --prop_file=smiles_prop.txt --save_file=save/model_3.ckpt-3 --target_prop='300 4 100' --result_filename=result.txt

The result will be written in result.txt

cvae's People

Contributors

jaechanglim avatar

Stargazers

 avatar  avatar Saeid avatar Gaopeng Ren avatar  avatar Abhinava Maddha avatar  avatar Cheng Ge avatar Jongbeom Kang avatar  avatar skyimbio avatar  avatar Yaju Senapi avatar Cody Zhao avatar Lakhder Amine avatar  avatar  avatar Jinny Han avatar Zijian Gao avatar Ana Laura Dias avatar Hyunkyung Choo avatar nanyeglm avatar  avatar  avatar Kariya Kosuke avatar  avatar  avatar Vikram avatar Matt avatar Sul  avatar  avatar Minseong Kim avatar lyingjay avatar daiyizheng avatar  avatar Peter Clarke avatar Peter Clarke avatar Lester Wang avatar Pigeon avatar Sandip Giri avatar Seonghwan Kim avatar  avatar Steven Bennett avatar  avatar  avatar armaank avatar Ramsey avatar Ruocheng Guo avatar seonu avatar Yip Yew Mun avatar  avatar JaminJeong avatar  avatar yangxu351 avatar  avatar Đăng Hồ avatar Lee Joongwon avatar pan xiaolin avatar Manajit Das avatar Rocco Meli avatar Sejeong Park avatar Roxana Noelia Villafañe avatar Rafael Pastrana avatar Geunho Choi avatar R. Patrick Xian avatar  avatar Gordon Li avatar  avatar  avatar  avatar Pengfei avatar LingXue Dai avatar Shashank Gupta avatar Wang-ZV avatar  avatar Jianwen Chen avatar Shijie Ren avatar Shuangjia Zheng avatar  avatar Ming-Yang Wang avatar Yu avatar tbwxmu avatar Ermia Azarkhalili avatar Yuan Liang avatar  avatar Hongchao Ji avatar  avatar Ben Blaiszik avatar  avatar  avatar  avatar Moritz Thürlemann avatar  avatar Moon seok hyun avatar  avatar Seongok Ryu avatar

Watchers

paper2code - bot avatar

cvae's Issues

What's the version of tensorflow ?

I used tf1.13 trigger a error:

Traceback (most recent call last):
File "/gxr/ziang/anaconda3/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1334, in _do_call
return fn(*args)
File "/gxr/ziang/anaconda3/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1319, in _run_fn
options, feed_dict, fetch_list, target_list, run_metadata)
File "/gxr/ziang/anaconda3/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1407, in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.InternalError: Blas GEMM launch failed : a.shape=(64, 512), b.shape=(512, 200), m=64, n=200, k=512
[[{{node MatMul_1}}]]
[[{{node Mean}}]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "train.py", line 71, in
cost = model.train(x, y, l, c)
File "/home/ziang/CVAE/model.py", line 143, in train
_, r_loss, l_loss = self.sess.run([self.opt, self.reconstr_loss, self.latent_loss], feed_dict = {self.X :x, self.Y:y, self.L : l, self.C : c})
File "/gxr/ziang/anaconda3/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 929, in run
run_metadata_ptr)
File "/gxr/ziang/anaconda3/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1152, in _run
feed_dict_tensor, options, run_metadata)
File "/gxr/ziang/anaconda3/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1328, in _do_run
run_metadata)
File "/gxr/ziang/anaconda3/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1348, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InternalError: Blas GEMM launch failed : a.shape=(64, 512), b.shape=(512, 200), m=64, n=200, k=512
[[node MatMul_1 (defined at /home/ziang/CVAE/model.py:105) ]]
[[node Mean (defined at /home/ziang/CVAE/model.py:75) ]]

Caused by op 'MatMul_1', defined at:
File "train.py", line 52, in
args
File "/home/ziang/CVAE/model.py", line 22, in init
self._create_network()
File "/home/ziang/CVAE/model.py", line 66, in _create_network
self.latent_vector, self.mean, self.log_sigma = self.encode()
File "/home/ziang/CVAE/model.py", line 105, in encode
log_sigma = tf.matmul(h, self.weights['out_log_sigma'])+self.biases['out_log_sigma']
File "/gxr/ziang/anaconda3/lib/python3.7/site-packages/tensorflow/python/ops/math_ops.py", line 2455, in matmul
a, b, transpose_a=transpose_a, transpose_b=transpose_b, name=name)
File "/gxr/ziang/anaconda3/lib/python3.7/site-packages/tensorflow/python/ops/gen_math_ops.py", line 5333, in mat_mul
name=name)
File "/gxr/ziang/anaconda3/lib/python3.7/site-packages/tensorflow/python/framework/op_def_library.py", line 788, in _apply_op_helper
op_def=op_def)
File "/gxr/ziang/anaconda3/lib/python3.7/site-packages/tensorflow/python/util/deprecation.py", line 507, in new_func
return func(*args, **kwargs)
File "/gxr/ziang/anaconda3/lib/python3.7/site-packages/tensorflow/python/framework/ops.py", line 3300, in create_op
op_def=op_def)
File "/gxr/ziang/anaconda3/lib/python3.7/site-packages/tensorflow/python/framework/ops.py", line 1801, in init
self._traceback = tf_stack.extract_stack()

InternalError (see above for traceback): Blas GEMM launch failed : a.shape=(64, 512), b.shape=(512, 200), m=64, n=200, k=512
[[node MatMul_1 (defined at /home/ziang/CVAE/model.py:105) ]]
[[node Mean (defined at /home/ziang/CVAE/model.py:75) ]]

About tensorflow

Hello, I noticed that many of the functions in your model.py involving the tensorflow library do not match the latest version of tensorflow. Do you have any updated code?

questions abount "Scaffold-based molecular design with a graph generative model"

I have read th paper and think that the project is particularly interesting. So I want to study the algorithm in the paper, but I found that the project of the repository on the github cannot be accessed-https://github.com/jaechanglim/GGM. Can you resume the access of the repository or provide a copy of the code? Thank you very much!
Best wishes.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.