Giter Club home page Giter Club logo

Comments (1)

kanojikajino avatar kanojikajino commented on June 24, 2024

質問ありがとうございます.申し訳ありません,コードの整理中に誤って落としておりました.

plogpを追加しましたので,更新分をpullしていただいて,再度お試しいただけますでしょうか?

def plogp(smiles_list, file_name='plogp.pklz', batch_size=1024):
n_iter = math.ceil(len(smiles_list) / batch_size)
try:
with gzip.open(file_name, 'rb') as f:
plogp_tensor = pickle.load(f)
if len(plogp_tensor) != len(smiles_list):
raise RuntimeError
except:
plogp_tensor_list = []
for each_batch_idx in tqdm(range(n_iter)):
packed_dataset = PackedMolecule.from_smiles(
smiles_list[each_batch_idx * batch_size
: min((each_batch_idx+1)*batch_size,
len(smiles_list))])
plogp_tensor_list.append(
penalized_logP(packed_dataset))
plogp_tensor = torch.cat(plogp_tensor_list)
with gzip.open(file_name, 'wb') as f:
pickle.dump(plogp_tensor, f)
return plogp_tensor

from ml4chem.

Related Issues (1)

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.