chemprop
chemprop copied to clipboard
[FEATURE]: v2 polymer functionality
some brief notes (excuse the mixing of atom/node and bond/edge):
- the primary difference of polymeric message passing is the introduction of atom and bond weights into the
BatchMolGraph(here) - during edge-based message passing, a message is calculated as normal and then multiplied by its weight (
w_bonds). That is, message aggregation becomes a fixed, weighted sum over messages (i.e., "static attention") - during graph aggregation, two things happen:
- a similar concept is applied to each node (
w_atoms) in the graph (i.e., a fixed, weighted {sum, mean}) - the graph-level representation is multiplied by its "degree_of_polymerization" (
degree_of_polym)
- a similar concept is applied to each node (
- we obtain these attributes via a new featurization scheme (main code block is here). There's a lot going on here, and I don't really understand it myself.
- the new featurization scheme also relies on the "polymer rules" (
list[str]) information being attached to a given polymer. These rules are parsed to obtain (i) the edge weights between repeating monomer units and (ii) the degree of polymerization