These are the models for specific tasks, like regression, multi-class classification and multi-label classification. In all these models we can choose to use single path MolMap architecture, which includes only one of descriptor map or fingerprint map, or double path MolMap, which combines the two.
These models are thin wrappers of MolMap nets, with different outcome activation functions.
Single path, descriptor
descriptor = MolMapRegression()
i = torch.rand((10, 13, 37, 37))
o = descriptor(i)
o.shape
Single path, fingerprint
fingerprint = MolMapRegression(conv_in1=3)
i = torch.rand((10, 3, 37, 36))
o = fingerprint(i)
o.shape
If the network is double path then we pass in a tuple of inputs
double_path = MolMapRegression(conv_in1=13, conv_in2=3)
i1 = torch.rand((10, 13, 37, 37))
i2 = torch.rand((10, 3, 37, 36))
o = double_path((i1, i2))
o.shape
Multi-class classification
For multi-class classification we use the softmax activation function. Softmax transforms a vector so that each value in the vector falls between 0 and 1 and the vector sums to one. It's the logistic transformation generalised to vectors. In practice we use logsoftmax because it's computationally more stable.
Single path, descriptor
descriptor = MolMapMultiClassClassification()
i = torch.rand((10, 13, 37, 37))
o = descriptor(i)
o.shape
o.exp().sum(dim=1)
Single path, fingerprint
fingerprint = MolMapMultiClassClassification(conv_in1=3)
i = torch.rand((10, 3, 37, 36))
o = fingerprint(i)
o.shape
o.exp().sum(dim=1)
If the network is double path then we pass in a tuple of inputs
double_path = MolMapMultiClassClassification(conv_in1=13, conv_in2=3)
i1 = torch.rand((10, 13, 37, 37))
i2 = torch.rand((10, 3, 37, 36))
o = double_path((i1, i2))
o.shape
o.exp().sum(dim=1)
Multi-label classification
For multi-label classification, each input can have multiple labels, and the belonging to one label is independent of belonging to the others, so we'll use the Sigmoid activation function.
Compared to the multi-class problem, we only have to switch the soft max activation to sigmoid.
Single path, descriptor
descriptor = MolMapMultiLabelClassification()
i = torch.rand((10, 13, 37, 37))
o = descriptor(i)
o.shape
o
Single path, fingerprint
fingerprint = MolMapMultiLabelClassification(conv_in1=3)
i = torch.rand((10, 3, 37, 36))
o = fingerprint(i)
o.shape
o
If the network is double path then we pass in a tuple of inputs
double_path = MolMapMultiLabelClassification(conv_in1=13, conv_in2=3)
i1 = torch.rand((10, 13, 37, 37))
i2 = torch.rand((10, 3, 37, 36))
o = double_path((i1, i2))
o.shape
o
Switch the order of descriptor and fingerprint map
double_path = MolMapMultiLabelClassification(conv_in1=3, conv_in2=13)
i1 = torch.rand((10, 13, 37, 37))
i2 = torch.rand((10, 3, 37, 36))
o = double_path((i2, i1))
o.shape
o