Switch to unified view

a b/docs/build/html/notes/cnn.html
1
2
<!DOCTYPE html>
3
4
<html xmlns="http://www.w3.org/1999/xhtml">
5
  <head>
6
    <meta charset="utf-8" />
7
    <title>CNN &#8212; DeepPurpose 0.0.1 documentation</title>
8
    <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
9
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
10
    <script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
11
    <script src="../_static/jquery.js"></script>
12
    <script src="../_static/underscore.js"></script>
13
    <script src="../_static/doctools.js"></script>
14
    <script src="../_static/language_data.js"></script>
15
    <link rel="index" title="Index" href="../genindex.html" />
16
    <link rel="search" title="Search" href="../search.html" />
17
    <link rel="next" title="MLP" href="mlp.html" />
18
    <link rel="prev" title="CNN+RNN" href="cnnrnn.html" />
19
   
20
  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
21
  
22
  
23
  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
24
25
  </head><body>
26
  
27
28
    <div class="document">
29
      <div class="documentwrapper">
30
        <div class="bodywrapper">
31
          
32
33
          <div class="body" role="main">
34
            
35
  <div class="section" id="cnn">
36
<h1>CNN<a class="headerlink" href="#cnn" title="Permalink to this headline">¶</a></h1>
37
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="k">class</span> <span class="nc">DeepPurpose</span><span class="o">.</span><span class="n">models</span><span class="o">.</span><span class="n">CNN</span><span class="p">(</span><span class="n">nn</span><span class="o">.</span><span class="n">Sequential</span><span class="p">)</span>
38
</pre></div>
39
</div>
40
<p><a class="reference external" href="https://en.wikipedia.org/wiki/Convolutional_neural_network">CNN (Convolutional Neural Network)</a> can be used to encode both drug and protein on <a class="reference external" href="https://en.wikipedia.org/wiki/Simplified_molecular-input_line-entry_system">SMILES</a>.</p>
41
<p><strong>constructor</strong> create CNN.</p>
42
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">encoding</span><span class="p">,</span> <span class="o">**</span><span class="n">config</span><span class="p">)</span>
43
</pre></div>
44
</div>
45
<ul class="simple">
46
<li><p><strong>encoding</strong> (string, “drug” or “protein”) - specify input type of model, “drug” or “protein”.</p></li>
47
<li><dl class="simple">
48
<dt><strong>config</strong> (kwargs, keyword arguments) - specify the parameter of CNN. The keys include</dt><dd><ul>
49
<li><p>cnn_drug_filters (list, each element is int) - specify the size of filter when encoding drug, e.g., cnn_drug_filters = [32,64,96].</p></li>
50
<li><p>cnn_drug_kernels (list, each element is int) - specify the size of kernel when encoding drug, e.g., cnn_drug_kernels = [4,6,8].</p></li>
51
<li><p>hidden_dim_drug (int) - specify the hidden dimension when encoding drug, e.g., hidden_dim_drug = 256.</p></li>
52
<li><p>cnn_target_filters (list, each element is int) - specify the size of filter when encoding protein, e.g, cnn_target_filters = [32,64,96].</p></li>
53
<li><p>cnn_target_kernels (list, each element is int) - specify the size of kernel when encoding protein, e.g, cnn_target_kernels = [4,8,12].</p></li>
54
<li><p>hidden_dim_protein (int) - specify the hidden dimension when encoding protein, e.g., hidden_dim_protein = 256.</p></li>
55
</ul>
56
</dd>
57
</dl>
58
</li>
59
</ul>
60
<p><strong>Calling functions</strong> implement the feedforward procedure of CNN.</p>
61
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">forward</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">v</span><span class="p">)</span>
62
</pre></div>
63
</div>
64
<ul class="simple">
65
<li><p><strong>v</strong> (torch.Tensor) - input feature of CNN.</p></li>
66
</ul>
67
</div>
68
69
70
          </div>
71
          
72
        </div>
73
      </div>
74
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
75
        <div class="sphinxsidebarwrapper">
76
<h1 class="logo"><a href="../index.html">DeepPurpose</a></h1>
77
78
79
80
81
82
83
84
85
<h3>Navigation</h3>
86
<p class="caption"><span class="caption-text">Background</span></p>
87
<ul>
88
<li class="toctree-l1"><a class="reference internal" href="introduction.html">Feature of DeepPurpose</a></li>
89
<li class="toctree-l1"><a class="reference internal" href="DTI.html">What is Drug Target Interaction?</a></li>
90
</ul>
91
<p class="caption"><span class="caption-text">How to run</span></p>
92
<ul>
93
<li class="toctree-l1"><a class="reference internal" href="download.html">Download</a></li>
94
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation</a></li>
95
<li class="toctree-l1"><a class="reference internal" href="casestudy.html">Case Study</a></li>
96
</ul>
97
<p class="caption"><span class="caption-text">Package Reference</span></p>
98
<ul class="current">
99
<li class="toctree-l1"><a class="reference internal" href="model.html">Model</a></li>
100
<li class="toctree-l1 current"><a class="reference internal" href="encoder.html">Drug/Target Encoder</a></li>
101
<li class="toctree-l1"><a class="reference internal" href="process_data.html">Processing Data</a></li>
102
<li class="toctree-l1"><a class="reference internal" href="configuration.html">Configuration</a></li>
103
<li class="toctree-l1"><a class="reference internal" href="utility_function.html">Utility Function</a></li>
104
</ul>
105
106
<div class="relations">
107
<h3>Related Topics</h3>
108
<ul>
109
  <li><a href="../index.html">Documentation overview</a><ul>
110
  <li><a href="encoder.html">Drug/Target Encoder</a><ul>
111
      <li>Previous: <a href="cnnrnn.html" title="previous chapter">CNN+RNN</a></li>
112
      <li>Next: <a href="mlp.html" title="next chapter">MLP</a></li>
113
  </ul></li>
114
  </ul></li>
115
</ul>
116
</div>
117
<div id="searchbox" style="display: none" role="search">
118
  <h3 id="searchlabel">Quick search</h3>
119
    <div class="searchformwrapper">
120
    <form class="search" action="../search.html" method="get">
121
      <input type="text" name="q" aria-labelledby="searchlabel" />
122
      <input type="submit" value="Go" />
123
    </form>
124
    </div>
125
</div>
126
<script>$('#searchbox').show(0);</script>
127
128
129
130
131
132
133
134
135
        </div>
136
      </div>
137
      <div class="clearer"></div>
138
    </div>
139
    <div class="footer">
140
      &copy;2020, Kexin Huang, Tianfan Fu.
141
      
142
      |
143
      Powered by <a href="http://sphinx-doc.org/">Sphinx 3.0.0</a>
144
      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
145
      
146
      |
147
      <a href="../_sources/notes/cnn.rst.txt"
148
          rel="nofollow">Page source</a>
149
    </div>
150
151
    
152
153
    
154
  </body>
155
</html>