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

Download this file

34 lines (26 with data), 11.3 kB

ÇĽ,îdocutils.nodesöîdocumentöôö)üö}ö(î	rawsourceöîöîchildrenö]öhîsectionöôö)üö}ö(hhh]ö(hîtitleöôö)üö}ö(hîCNNöh]öhîTextöôöîCNNöůöüö}ö(hhîparentöhhhîsourceöNîlineöNubaî
attributesö}ö(îidsö]öîclassesö]öînamesö]öîdupnamesö]öîbackrefsö]öuîtagnameöhhhhhhîK/Users/futianfan/Downloads/spring2020/DeepPurpose/docs/source/notes/cnn.rstöhKubhî
literal_blocköôö)üö}ö(hî+class DeepPurpose.models.CNN(nn.Sequential)öh]öhî+class DeepPurpose.models.CNN(nn.Sequential)öůöüö}ö(hhhh-ubah}ö(h]öh!]öh#]öh%]öh']öî	xml:spaceöîpreserveöîforceöëîlanguageöîpythonöîhighlight_argsö}öuh)h+hh*hKhhhhubhî	paragraphöôö)üö}ö(hîÚ`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>`_.öh]ö(hî	referenceöôö)üö}ö(hîb`CNN (Convolutional Neural Network) <https://en.wikipedia.org/wiki/Convolutional_neural_network>`_öh]öhî"CNN (Convolutional Neural Network)öůöüö}ö(hî"CNN (Convolutional Neural Network)öhhJubah}ö(h]öh!]öh#]öh%]öh']öînameöî"CNN (Convolutional Neural Network)öîrefuriöî:https://en.wikipedia.org/wiki/Convolutional_neural_networköuh)hHhhDubhîtargetöôö)üö}ö(hî= <https://en.wikipedia.org/wiki/Convolutional_neural_network>öh]öh}ö(h]öî cnn-convolutional-neural-networköah!]öh#]öî"cnn (convolutional neural network)öah%]öh']öîrefuriöh\uh)h]î
referencedöKhhDubhî0 can be used to encode both drug and protein on öůöüö}ö(hî0 can be used to encode both drug and protein on öhhDhhhNhNubhI)üö}ö(hîV`SMILES <https://en.wikipedia.org/wiki/Simplified_molecular-input_line-entry_system>`_öh]öhîSMILESöůöüö}ö(hîSMILESöhhrubah}ö(h]öh!]öh#]öh%]öh']öînameöhzh[îJhttps://en.wikipedia.org/wiki/Simplified_molecular-input_line-entry_systemöuh)hHhhDubh^)üö}ö(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)h]hlKhhDubhî.öůöüö}ö(hî.öhhDhhhNhNubeh}ö(h]öh!]öh#]öh%]öh']öuh)hBhh*hKhhhhubhC)üö}ö(hî**constructor** create CNN.öh]ö(hîstrongöôö)üö}ö(hî**constructor**öh]öhîconstructoröůöüö}ö(hhhhíubah}ö(h]öh!]öh#]öh%]öh']öuh)hčhhŤubhî create CNN.öůöüö}ö(hî create CNN.öhhŤhhhNhNubeh}ö(h]öh!]öh#]öh%]öh']öuh)hBhh*hKhhhhubh,)üö}ö(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î_**encoding** (string, "drug" or "protein") - specify input type of model, "drug" or "protein".
öh]öhC)üö}ö(hî^**encoding** (string, "drug" or "protein") - specify input type of model, "drug" or "protein".öh]ö(há)üö}ö(hî**encoding**öh]öhîencodingöůöüö}ö(hhhh┘ubah}ö(h]öh!]öh#]öh%]öh']öuh)hčhhŇubhîb (string, ÔÇťdrugÔÇŁ or ÔÇťproteinÔÇŁ) - specify input type of model, ÔÇťdrugÔÇŁ or ÔÇťproteinÔÇŁ.öůöüö}ö(hîR (string, "drug" or "protein") - specify input type of model, "drug" or "protein".öhhŇubeh}ö(h]öh!]öh#]öh%]öh']öuh)hBhh*hKhhĐubah}ö(h]öh!]öh#]öh%]öh']öuh)h¤hh╠hhhh*hNubhđ)üö}ö(hXr**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.


öh]öhîdefinition_listöôö)üö}ö(hhh]öhîdefinition_list_itemöôö)üö}ö(hXN**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.


öh]ö(hîtermöôö)üö}ö(hîW**config** (kwargs, keyword arguments) - specify the parameter of CNN. The keys includeöh]ö(há)üö}ö(hî
**config**öh]öhîconfigöůöüö}ö(hhhj
ubah}ö(h]öh!]öh#]öh%]öh']öuh)hčhj	ubhîM (kwargs, keyword arguments) - specify the parameter of CNN. The keys includeöůöüö}ö(hîM (kwargs, keyword arguments) - specify the parameter of CNN. The keys includeöhj	ubeh}ö(h]öh!]öh#]öh%]öh']öuh)jhh*hK hjubhî
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)üö}ö(hj0h]ö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].öůöüö}ö(hj0hj2ubah}ö(h]öh!]öh#]öh%]öh']öuh)hBhh*hKhj.ubah}ö(h]öh!]öh#]öh%]öh']öuh)h¤hj+ubhđ)üö}ö(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)üö}ö(hjGh]ö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].öůöüö}ö(hjGhjIubah}ö(h]öh!]öh#]öh%]öh']öuh)hBhh*hKhjEubah}ö(h]öh!]öh#]öh%]öh']öuh)h¤hj+ubhđ)üö}ö(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¤hj+ubhđ)üö}ö(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)üö}ö(hjuh]ö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].öůöüö}ö(hjuhjwubah}ö(h]öh!]öh#]öh%]öh']öuh)hBhh*hKhjsubah}ö(h]öh!]öh#]öh%]öh']öuh)h¤hj+ubhđ)üö}ö(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¤hj+ubhđ)üö}ö(hîqhidden_dim_protein (int) - specify the hidden dimension when encoding protein, e.g., hidden_dim_protein = 256.


öh]öhC)üö}ö(hînhidden_dim_protein (int) - specify the hidden dimension when encoding protein, e.g., hidden_dim_protein = 256.ö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¤hj+ubeh}ö(h]öh!]öh#]öh%]öh']öîbulletöî*öuh)h╩hh*hKhj(ubah}ö(h]öh!]öh#]öh%]öh']öuh)j&hjubeh}ö(h]öh!]öh#]öh%]öh']öuh)jhh*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îA**Calling functions** implement the feedforward procedure of CNN.öh]ö(há)üö}ö(hî**Calling functions**öh]öhîCalling functionsöůöüö}ö(hhhjŃubah}ö(h]öh!]öh#]öh%]öh']öuh)hčhj▀ubhî, implement the feedforward procedure of CNN.öůöüö}ö(hî, implement the feedforward procedure of CNN.öhj▀hhhNhNubeh}ö(h]öh!]öh#]öh%]öh']öuh)hBhh*hK"hhhhubh,)üö}ö(hîforward(self, v)öh]öhîforward(self, v)öůöüö}ö(hhhjŘubah}ö(h]öh!]öh#]öh%]öh']öh;h<h=ëh>îpythonöh@}öuh)h+hh*hK$hhhhubh╦)üö}ö(hhh]öhđ)üö}ö(hî/**v** (torch.Tensor) - input feature of CNN.


öh]öhC)üö}ö(hî,**v** (torch.Tensor) - input feature of CNN.öh]ö(há)üö}ö(hî**v**öh]öhîvöůöüö}ö(hhhjubah}ö(h]öh!]öh#]öh%]öh']öuh)hčhjubhî' (torch.Tensor) - input feature of CNN.öůöüö}ö(hî' (torch.Tensor) - input feature of CNN.öhjubeh}ö(h]öh!]öh#]öh%]öh']öuh)hBhh*hK)hjubah}ö(h]öh!]öh#]öh%]öh']öuh)h¤hjhhhh*hNubah}ö(h]öh!]öh#]öh%]öh']öj┐j└uh)h╩hh*hK)hhhhubeh}ö(h]öîcnnöah!]öh#]öîcnnö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öjgî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ö}ö(jAj>hhhehîhëuî	nametypesö}ö(jANhhłhîłuh}ö(j>hheh_hëhâuî
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.