[0a9449]: / docs / build / html / _sources / notes / cnn.rst.txt

Download this file

45 lines (20 with data), 1.6 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
CNN
===========================
.. code-block:: python
class DeepPurpose.models.CNN(nn.Sequential)
`CNN (Convolutional Neural Network) <https://en.wikipedia.org/wiki/Convolutional_neural_network>`_ can be used to encode both drug and protein on `SMILES <https://en.wikipedia.org/wiki/Simplified_molecular-input_line-entry_system>`_.
**constructor** create CNN.
.. code-block:: python
__init__(self, encoding, **config)
* **encoding** (string, "drug" or "protein") - specify input type of model, "drug" or "protein".
* **config** (kwargs, keyword arguments) - specify the parameter of CNN. The keys include
* cnn_drug_filters (list, each element is int) - specify the size of filter when encoding drug, e.g., cnn_drug_filters = [32,64,96].
* cnn_drug_kernels (list, each element is int) - specify the size of kernel when encoding drug, e.g., cnn_drug_kernels = [4,6,8].
* hidden_dim_drug (int) - specify the hidden dimension when encoding drug, e.g., hidden_dim_drug = 256.
* cnn_target_filters (list, each element is int) - specify the size of filter when encoding protein, e.g, cnn_target_filters = [32,64,96].
* cnn_target_kernels (list, each element is int) - specify the size of kernel when encoding protein, e.g, cnn_target_kernels = [4,8,12].
* hidden_dim_protein (int) - specify the hidden dimension when encoding protein, e.g., hidden_dim_protein = 256.
**Calling functions** implement the feedforward procedure of CNN.
.. code-block:: python
forward(self, v)
* **v** (torch.Tensor) - input feature of CNN.