Replies: 3 comments
-
I've been thinking about the same concept as it relates to v2. Currently, it wouldn't be very hard to hack this together in the v2 by subclassing More broadly, it would be nice (in v2.1 or 2.2) if we could programmatically encode this behavior somehow. That is, given a On a more general note, given a blocks: list[MessagePassing]
input_i_to_block_j = [0, 1, 0] # a map from input to block index
mp = MulticomponentMessagePassing([blocks[i] for i in input_i_to_block_j]) But we will first need to delete these lines: elif not shared and len(blocks) != n_components:
raise ValueError(
"arg 'n_components' must be equal to `len(blocks)` if 'shared' is False! "
f"got: {n_components} and {len(blocks)}, respectively."
) |
Beta Was this translation helpful? Give feedback.
-
@davidegraff |
Beta Was this translation helpful? Give feedback.
-
As mentioned on your other issue, I've converted this to a discussion, which is the forum we're planning to use going forward for these types of questions that are more general requests for advice/help or that require more extended discussion. To answer your question about the stable v2 release, it should be released by the end of February. |
Beta Was this translation helpful? Give feedback.
-
Hi!
As #570 mentioned before, I want to modify the multi-molecule embedding process, tailoring it to meet unique requirements of my project. In short, my data looks like this:
The predicted property is collectively determined by multiple molecules, with varying degrees of importance. The first column represents the primary molecule, while the remaining columns correspond to secondary molecules. What I want to do is use Chemprop's multi-molecule models to embed these molecules, but with a slight variation in the embedding approach. Its something like this:
The main modifications needed involve using a separate MPNN encoder for the first primary molecule, while the remaining secondary molecules all use another shared encoder (i.e., mpn_shared = True). The encodings obtained from the secondary molecules through the MPNN encoder need to be summed and then concatenated with the encoding of the primary molecule to generate the final embedding for subsequent predictions.
Below are three modifications I made to the Chemprop source code:
mpy.py
model.py
I have tested the modified, and it appears to be functioning as intended, but I am uncertain about the completeness and correctness of my modifications. Before proceeding further, I would like to know if there are any oversights or improvements needed in my modified code. Thank you in advance!
Due to English not being my native language, there might be some grammar or semantic errors in my expression. I appreciate your understanding.
Beta Was this translation helpful? Give feedback.
All reactions