Giter VIP home page Giter VIP logo

Comments (4)

davidegraff avatar davidegraff commented on May 27, 2024

Hi @miquelduranfrigola,

We currently don’t support multitask optimization in molpal, so setting the number of tasks to anything other than 1 will break the code. How are you currently using the code?

from molpal.

miquelduranfrigola avatar miquelduranfrigola commented on May 27, 2024

Hi @davidegraff

Thanks for the fast reply! I was interested in the fact that you are using PyTorch Lightning, so my plan was to use the MPNN class of MolPal as a drop-in-replacement for my ChemProp multi-task regression models, which are typically slow. I hope this makes sense?

Thanks!
M

from molpal.

davidegraff avatar davidegraff commented on May 27, 2024

yeah so there is a bug right now in molpal.models.mpnmodels.py#L191.
This block:

def make_datasets(
    self, xs: Iterable[str], ys: Sequence[float]
) -> Tuple[MoleculeDataset, MoleculeDataset]:
    """Split xs and ys into train and validation datasets"""

    data = MoleculeDataset([
        MoleculeDatapoint(smiles=[x], targets=[y])
        for x, y in zip(xs, ys)
    ])
    ...

assumes that ys is an array of single-task target values, so it's a vector of length n rather than an array of shape n x 1. If you iterate through an n x m array and then wrap it in a list (as in targets=[y]), then the target of each point is a list of m floats rather than m separate targets.

I just fixed this by checking the target shape in MPNN.train(#10). let me know if this problem persists after the latest commit

from molpal.

miquelduranfrigola avatar miquelduranfrigola commented on May 27, 2024

Hi @davidegraff it works nicely now with the latest commit! Many thanks for your help!

from molpal.

Related Issues (20)

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.