[0a9449]: / docs / build / doctrees / notes / cnnrnn.doctree

Download this file

42 lines (37 with data), 14.3 kB

ÇĽŕ7îdocutils.nodesöîdocumentöôö)üö}ö(î	rawsourceöîöîchildrenö]öhîsectionöôö)üö}ö(hhh]ö(hîtitleöôö)üö}ö(hîCNN+RNNöh]öhîTextöôöîCNN+RNNöůöüö}ö(hhîparentöhhhîsourceöNîlineöNubaî
attributesö}ö(îidsö]öîclassesö]öînamesö]öîdupnamesö]öîbackrefsö]öuîtagnameöhhhhhhîN/Users/futianfan/Downloads/spring2020/DeepPurpose/docs/source/notes/cnnrnn.rstöhKubhî
literal_blocköôö)üö}ö(hî/class DeepPurpose.models.CNN_RNN(nn.Sequential)öh]öhî/class DeepPurpose.models.CNN_RNN(nn.Sequential)öůöüö}ö(hhhh-ubah}ö(h]öh!]öh#]öh%]öh']öî	xml:spaceöîpreserveöîforceöëîlanguageöîpythonöîhighlight_argsö}öuh)h+hh*hKhhhhubhî	paragraphöôö)üö}ö(hîâCNN_RNN means a GRU/LSTM on top of a CNN on `SMILES <https://en.wikipedia.org/wiki/Simplified_molecular-input_line-entry_system>`_.öh]ö(hî,CNN_RNN means a GRU/LSTM on top of a CNN on öůöüö}ö(hî,CNN_RNN means a GRU/LSTM on top of a CNN on öhhDhhhNhNubhî	referenceöôö)üö}ö(hîV`SMILES <https://en.wikipedia.org/wiki/Simplified_molecular-input_line-entry_system>`_öh]öhîSMILESöůöüö}ö(hîSMILESöhhOubah}ö(h]öh!]öh#]öh%]öh']öînameöhWîrefuriöîJhttps://en.wikipedia.org/wiki/Simplified_molecular-input_line-entry_systemöuh)hMhhDubhîtargetöôö)üö}ö(hîM <https://en.wikipedia.org/wiki/Simplified_molecular-input_line-entry_system>öh]öh}ö(h]öîsmilesöah!]öh#]öîsmilesöah%]öh']öîrefuriöh`uh)haî
referencedöKhhDubhî.öůöüö}ö(hî.öhhDhhhNhNubeh}ö(h]öh!]öh#]öh%]öh']öuh)hBhh*hKhhhhubhC)üö}ö(hî**constructor** create CNN_RNNöh]ö(hîstrongöôö)üö}ö(hî**constructor**öh]öhîconstructoröůöüö}ö(hhhhéubah}ö(h]öh!]öh#]öh%]öh']öuh)hÇhh|ubhî create CNN_RNNöůöüö}ö(hî create CNN_RNNöhh|hhhNhNubeh}ö(h]öh!]öh#]öh%]öh']öuh)hBhh*hKhhhhubh,)üö}ö(hî"__init__(self, encoding, **config)öh]öhî"__init__(self, encoding, **config)öůöüö}ö(hhhhŤubah}ö(h]öh!]öh#]öh%]öh']öh;h<h=ëh>îpythonöh@}öuh)h+hh*hKhhhhubhîbullet_listöôö)üö}ö(hhh]ö(hî	list_itemöôö)üö}ö(hîU**encoding** (string, "drug" or "protein") - specify input type, "drug" or "protein".öh]öhC)üö}ö(hh┤h]ö(hü)üö}ö(hî**encoding**öh]öhîencodingöůöüö}ö(hhhh╣ubah}ö(h]öh!]öh#]öh%]öh']öuh)hÇhhÂubhîY (string, ÔÇťdrugÔÇŁ or ÔÇťproteinÔÇŁ) - specify input type, ÔÇťdrugÔÇŁ or ÔÇťproteinÔÇŁ.öůöüö}ö(hîI (string, "drug" or "protein") - specify input type, "drug" or "protein".öhhÂubeh}ö(h]öh!]öh#]öh%]öh']öuh)hBhh*hKhh▓ubah}ö(h]öh!]öh#]öh%]öh']öuh)h░hhşhhhh*hNubh▒)üö}ö(hX_**config** (kwargs, keyword arguments) - specify the parameter of transformer. 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].
      * rnn_drug_hid_dim (int) - specify the hidden dimension of RNN when encoding drug, e.g., rnn_drug_hid_dim = 64.
      * rnn_drug_n_layers (int) - specify number of layer in RNN when encoding drug, .e.g, rnn_drug_n_layers = 2.
      * rnn_drug_bidirectional (bool) - specify if RNN is bidirectional when encoding drug, .e.g, rnn_drug_bidirectional = True.
      * 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.
      * rnn_target_hid_dim (int) - specify hidden dimension of RNN when encoding protein, e.g., rnn_target_hid_dim = 64.
      * rnn_target_n_layers (int) - specify the number of layer in RNN when encoding protein, e.g., rnn_target_n_layers = 2.
      * rnn_target_bidirectional (bool) - specify if RNN is bidirectional when encoding protein, e.g., rnn_target_bidirectional = True

öh]öhîdefinition_listöôö)üö}ö(hhh]öhîdefinition_list_itemöôö)üö}ö(hX**config** (kwargs, keyword arguments) - specify the parameter of transformer. 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].
* rnn_drug_hid_dim (int) - specify the hidden dimension of RNN when encoding drug, e.g., rnn_drug_hid_dim = 64.
* rnn_drug_n_layers (int) - specify number of layer in RNN when encoding drug, .e.g, rnn_drug_n_layers = 2.
* rnn_drug_bidirectional (bool) - specify if RNN is bidirectional when encoding drug, .e.g, rnn_drug_bidirectional = True.
* 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.
* rnn_target_hid_dim (int) - specify hidden dimension of RNN when encoding protein, e.g., rnn_target_hid_dim = 64.
* rnn_target_n_layers (int) - specify the number of layer in RNN when encoding protein, e.g., rnn_target_n_layers = 2.
* rnn_target_bidirectional (bool) - specify if RNN is bidirectional when encoding protein, e.g., rnn_target_bidirectional = True

öh]ö(hîtermöôö)üö}ö(hî_**config** (kwargs, keyword arguments) - specify the parameter of transformer. The keys includeöh]ö(hü)üö}ö(hî
**config**öh]öhîconfigöůöüö}ö(hhhhÝubah}ö(h]öh!]öh#]öh%]öh']öuh)hÇhhÚubhîU (kwargs, keyword arguments) - specify the parameter of transformer. The keys includeöůöüö}ö(hîU (kwargs, keyword arguments) - specify the parameter of transformer. The keys includeöhhÚubeh}ö(h]öh!]öh#]öh%]öh']öuh)hšhh*hK!hhŃubhî
definitionöôö)üö}ö(hhh]öhČ)üö}ö(hhh]ö(h▒)üö}ö(hîécnn_drug_filters (list, each element is int) - specify the size of filter when encoding drug, e.g., cnn_drug_filters = [32,64,96].öh]öhC)üö}ö(hjh]öhîécnn_drug_filters (list, each element is int) - specify the size of filter when encoding drug, e.g., cnn_drug_filters = [32,64,96].öůöüö}ö(hjhjubah}ö(h]öh!]öh#]öh%]öh']öuh)hBhh*hKhjubah}ö(h]öh!]öh#]öh%]öh']öuh)h░hjubh▒)üö}ö(hîcnn_drug_kernels (list, each element is int) - specify the size of kernel when encoding drug, e.g., cnn_drug_kernels = [4,6,8].öh]öhC)üö}ö(hj'h]öhîcnn_drug_kernels (list, each element is int) - specify the size of kernel when encoding drug, e.g., cnn_drug_kernels = [4,6,8].öůöüö}ö(hj'hj)ubah}ö(h]öh!]öh#]öh%]öh']öuh)hBhh*hKhj%ubah}ö(h]öh!]öh#]öh%]öh']öuh)h░hjubh▒)üö}ö(hîmrnn_drug_hid_dim (int) - specify the hidden dimension of RNN when encoding drug, e.g., rnn_drug_hid_dim = 64.öh]öhC)üö}ö(hj>h]öhîmrnn_drug_hid_dim (int) - specify the hidden dimension of RNN when encoding drug, e.g., rnn_drug_hid_dim = 64.öůöüö}ö(hj>hj@ubah}ö(h]öh!]öh#]öh%]öh']öuh)hBhh*hKhj<ubah}ö(h]öh!]öh#]öh%]öh']öuh)h░hjubh▒)üö}ö(hîirnn_drug_n_layers (int) - specify number of layer in RNN when encoding drug, .e.g, rnn_drug_n_layers = 2.öh]öhC)üö}ö(hjUh]öhîirnn_drug_n_layers (int) - specify number of layer in RNN when encoding drug, .e.g, rnn_drug_n_layers = 2.öůöüö}ö(hjUhjWubah}ö(h]öh!]öh#]öh%]öh']öuh)hBhh*hKhjSubah}ö(h]öh!]öh#]öh%]öh']öuh)h░hjubh▒)üö}ö(hîxrnn_drug_bidirectional (bool) - specify if RNN is bidirectional when encoding drug, .e.g, rnn_drug_bidirectional = True.öh]öhC)üö}ö(hjlh]öhîxrnn_drug_bidirectional (bool) - specify if RNN is bidirectional when encoding drug, .e.g, rnn_drug_bidirectional = True.öůöüö}ö(hjlhjnubah}ö(h]öh!]öh#]öh%]öh']öuh)hBhh*hKhjjubah}ö(h]öh!]öh#]öh%]öh']öuh)h░hjubh▒)üö}ö(hîehidden_dim_drug (int) - specify the hidden dimension when encoding drug, e.g., hidden_dim_drug = 256.öh]öhC)üö}ö(hjâh]öhîehidden_dim_drug (int) - specify the hidden dimension when encoding drug, e.g., hidden_dim_drug = 256.öůöüö}ö(hjâhjůubah}ö(h]öh!]öh#]öh%]öh']öuh)hBhh*hKhjüubah}ö(h]öh!]öh#]öh%]öh']öuh)h░hjubh▒)üö}ö(hîłcnn_target_filters (list, each element is int) - specify the size of filter when encoding protein, e.g, cnn_target_filters = [32,64,96].öh]öhC)üö}ö(hjÜh]öhîłcnn_target_filters (list, each element is int) - specify the size of filter when encoding protein, e.g, cnn_target_filters = [32,64,96].öůöüö}ö(hjÜhjťubah}ö(h]öh!]öh#]öh%]öh']öuh)hBhh*hKhjśubah}ö(h]öh!]öh#]öh%]öh']öuh)h░hjubh▒)üö}ö(hîćcnn_target_kernels (list, each element is int) - specify the size of kernel when encoding protein, e.g, cnn_target_kernels = [4,8,12].öh]öhC)üö}ö(hj▒h]öhîćcnn_target_kernels (list, each element is int) - specify the size of kernel when encoding protein, e.g, cnn_target_kernels = [4,8,12].öůöüö}ö(hj▒hj│ubah}ö(h]öh!]öh#]öh%]öh']öuh)hBhh*hKhj»ubah}ö(h]öh!]öh#]öh%]öh']öuh)h░hjubh▒)üö}ö(hînhidden_dim_protein (int) - specify the hidden dimension when encoding protein, e.g., hidden_dim_protein = 256.öh]öhC)üö}ö(hj╚h]öhînhidden_dim_protein (int) - specify the hidden dimension when encoding protein, e.g., hidden_dim_protein = 256.öůöüö}ö(hj╚hj╩ubah}ö(h]öh!]öh#]öh%]öh']öuh)hBhh*hKhjĂubah}ö(h]öh!]öh#]öh%]öh']öuh)h░hjubh▒)üö}ö(hîprnn_target_hid_dim (int) - specify hidden dimension of RNN when encoding protein, e.g., rnn_target_hid_dim = 64.öh]öhC)üö}ö(hj▀h]öhîprnn_target_hid_dim (int) - specify hidden dimension of RNN when encoding protein, e.g., rnn_target_hid_dim = 64.öůöüö}ö(hj▀hjßubah}ö(h]öh!]öh#]öh%]öh']öuh)hBhh*hKhjŢubah}ö(h]öh!]öh#]öh%]öh']öuh)h░hjubh▒)üö}ö(hîtrnn_target_n_layers (int) - specify the number of layer in RNN when encoding protein, e.g., rnn_target_n_layers = 2.öh]öhC)üö}ö(hj÷h]öhîtrnn_target_n_layers (int) - specify the number of layer in RNN when encoding protein, e.g., rnn_target_n_layers = 2.öůöüö}ö(hj÷hj°ubah}ö(h]öh!]öh#]öh%]öh']öuh)hBhh*hKhj˘ubah}ö(h]öh!]öh#]öh%]öh']öuh)h░hjubh▒)üö}ö(hîÇrnn_target_bidirectional (bool) - specify if RNN is bidirectional when encoding protein, e.g., rnn_target_bidirectional = True

öh]öhC)üö}ö(hî~rnn_target_bidirectional (bool) - specify if RNN is bidirectional when encoding protein, e.g., rnn_target_bidirectional = Trueöh]öhî~rnn_target_bidirectional (bool) - specify if RNN is bidirectional when encoding protein, e.g., rnn_target_bidirectional = Trueöůöüö}ö(hjhjubah}ö(h]öh!]öh#]öh%]öh']öuh)hBhh*hK hjubah}ö(h]öh!]öh#]öh%]öh']öuh)h░hjubeh}ö(h]öh!]öh#]öh%]öh']öîbulletöî*öuh)hźhh*hKhjubah}ö(h]öh!]öh#]öh%]öh']öuh)jhhŃubeh}ö(h]öh!]öh#]öh%]öh']öuh)hßhh*hK!hhŮubah}ö(h]öh!]öh#]öh%]öh']öuh)h▄hhěubah}ö(h]öh!]öh#]öh%]öh']öuh)h░hhşhhhNhNubeh}ö(h]öh!]öh#]öh%]öh']öj)j*uh)hźhh*hKhhhhubhC)üö}ö(hîE**Calling functions** implement the feedforward procedure of CNN_RNN.öh]ö(hü)üö}ö(hî**Calling functions**öh]öhîCalling functionsöůöüö}ö(hhhjMubah}ö(h]öh!]öh#]öh%]öh']öuh)hÇhjIubhî0 implement the feedforward procedure of CNN_RNN.öůöüö}ö(hî0 implement the feedforward procedure of CNN_RNN.öhjIhhhNhNubeh}ö(h]öh!]öh#]öh%]öh']öuh)hBhh*hK#hhhhubh,)üö}ö(hîforward(self, v)öh]öhîforward(self, v)öůöüö}ö(hhhjfubah}ö(h]öh!]öh#]öh%]öh']öh;h<h=ëh>îpythonöh@}öuh)h+hh*hK&hhhhubhČ)üö}ö(hhh]öh▒)üö}ö(hî3**v** (torch.Tensor) - input feature of CNN_RNN.


öh]öhC)üö}ö(hî0**v** (torch.Tensor) - input feature of CNN_RNN.öh]ö(hü)üö}ö(hî**v**öh]öhîvöůöüö}ö(hhhjüubah}ö(h]öh!]öh#]öh%]öh']öuh)hÇhj}ubhî+ (torch.Tensor) - input feature of CNN_RNN.öůöüö}ö(hî+ (torch.Tensor) - input feature of CNN_RNN.öhj}ubeh}ö(h]öh!]öh#]öh%]öh']öuh)hBhh*hK+hjyubah}ö(h]öh!]öh#]öh%]öh']öuh)h░hjvhhhh*hNubah}ö(h]öh!]öh#]öh%]öh']öj)j*uh)hźhh*hK+hhhhubeh}ö(h]öîcnn-rnnöah!]öh#]öîcnn+rnnöah%]öh']öuh)h	hhhhhh*hKubah}ö(h]öh!]öh#]öh%]öh']öîsourceöh*uh)hîcurrent_sourceöNîcurrent_lineöNîsettingsöîdocutils.frontendöîValuesöôö)üö}ö(hNî	generatoröNî	datestampöNîsource_linköNî
source_urlöNî
toc_backlinksöîentryöîfootnote_backlinksöKî
sectnum_xformöKîstrip_commentsöNîstrip_elements_with_classesöNî
strip_classesöNîreport_levelöKî
halt_levelöKîexit_status_levelöKîdebugöNîwarning_streamöNî	tracebacköłîinput_encodingöî	utf-8-sigöîinput_encoding_error_handleröîstrictöîoutput_encodingöîutf-8öîoutput_encoding_error_handleröjĐîerror_encodingöîUTF-8öîerror_encoding_error_handleröîbackslashreplaceöî
language_codeöîenöîrecord_dependenciesöNîconfigöNî	id_prefixöhîauto_id_prefixöîidöî
dump_settingsöNîdump_internalsöNîdump_transformsöNîdump_pseudo_xmlöNîexpose_internalsöNîstrict_visitoröNî_disable_configöNî_sourceöh*î_destinationöNî
_config_filesö]öîpep_referencesöNîpep_base_urlöî https://www.python.org/dev/peps/öîpep_file_url_templateöîpep-%04döîrfc_referencesöNîrfc_base_urlöîhttps://tools.ietf.org/html/öî	tab_widthöKîtrim_footnote_reference_spaceöëîfile_insertion_enabledöłîraw_enabledöKîsyntax_highlightöîlongöîsmart_quotesöłîsmartquotes_localesö]öîcharacter_level_inline_markupöëîdoctitle_xformöëî
docinfo_xformöKîsectsubtitle_xformöëîembed_stylesheetöëîcloak_email_addressesöłîenvöNubîreporteröNîindirect_targetsö]öîsubstitution_defsö}öîsubstitution_namesö}öîrefnamesö}öîrefidsö}öînameidsö}ö(jźjĘhlhiuî	nametypesö}ö(jźNhlłuh}ö(jĘhhihcuî
footnote_refsö}öî
citation_refsö}öî
autofootnotesö]öîautofootnote_refsö]öîsymbol_footnotesö]öîsymbol_footnote_refsö]öî	footnotesö]öî	citationsö]öîautofootnote_startöKîsymbol_footnote_startöKî
id_counteröîcollectionsöîCounteröôö}öůöRöîparse_messagesö]öîtransform_messagesö]öîtransformeröNî
decorationöNhhub.