/usr/local/lib64/python3.6/site-packages/caffe2/python/models/__pycache__
NameSizeModeActions
download.cpython-36.pyc65060644editdlrm
imagenet_trainer_test_utils.cpython-36.pyc40890644editdlrm
resnet.cpython-36.pyc63690644editdlrm
resnet_test.cpython-36.pyc23910644editdlrm
shufflenet.cpython-36.pyc44160644editdlrm
shufflenet_test.cpython-36.pyc24510644editdlrm
__init__.cpython-36.pyc1560644editdlrm
__sym_init__.cpython-36.pyc6150644editdlrm
Edit: /usr/local/lib64/python3.6/site-packages/caffe2/python/models/__pycache__/shufflenet.cpython-36.pyc (4416B)
3 Eg@s^ddlmZdddddgdddd dgdd d d dgdd dddgdZGdddZdddZdS))brew0`itii`iiii)z0.5xz1.0xz1.5xz2.0xc@sLeZdZdddZddZdd d Zdd d ZdddZddZddZ dS)ShuffleNetV2Builder1.0xFh㈵>c CsJ||_||_||_||_||_t||_dddg|_||_||_ | |_ dS)N) model prev_blobnum_input_channels num_labels num_groupsOUTPUT_CHANNELSoutput_channels stage_repeatsis_test detection bn_epsilon) selfrdatarrrwidthrrrrK/usr/local/lib64/python3.6/site-packages/caffe2/python/models/shufflenet.py__init__s   zShuffleNetV2Builder.__init__c Cs0|jd}tj|j|jd|j|difddd|_tj|j|jdddd|_xtt|jd d |j D]b\}\}}d j |dd}|j ||||}x2t |D]&}d j |dd |d }|j ||qWqfWtj|j|jd ||jd d d|_|jj|jddd|_tj|j|jdj |j|jd |j|_dS)NrZ stage1_convMSRAFillrr ) weight_initkernelstrideZ stage1_pool)r$r%zstage{}_stride{}zstage{}_stride{}_repeat{}Zconv5)r$avg_poolrz last_out_L{})rrconvrrrZmax_pool enumerateziprformatadd_spatial_ds_unitrangeadd_basic_unitZ last_convZ AveragePoolr(Zfcrlast_out)r in_channelsidx out_channelsZ n_repeatsprefixirrr create/s4   "     zShuffleNetV2Builder.createcCs|j}}|d}|jr,|j||d||}|j||d||}|j||d||}|jrn|j||d||}|j||d||}|j||d||}|j||d||}tj|j||g|d |_|jjj |j|d |j d d |_dS) Nr Z_left_detectionZ left_dwconvZ _left_conv1_right_detection _right_conv1 _right_dwconv _right_conv2_concat _ch_shuffler&)groupr$) rradd_detection_unitadd_dwconv3x3_bnadd_conv1x1_bnrconcatrnetChannelShuffler)rr4r1r3r%rightleftrrr r-Rs.         z'ShuffleNetV2Builder.add_spatial_ds_unitr&cCs|d}|d}|d}|jjj|j||g|jrH|j||d||}|j||d||}|j||d||}|j||d||}tj |j||g|d|_|jjj |j|d |j d d |_dS) Nr _left_rightr7r8r9r:r;r<r&)r=r$) rrBZSplitrrr>r@r?rrArCr)rr4r1r%rErDrrr r/ss$      z"ShuffleNetV2Builder.add_basic_unitrc CsJtj|j||d|||dif||d }tj|j||d||j|jd}|S)NZ_convr")r$r#r=pad_bn)epsilonr)rr)r spatial_bnrr)rrr4r1r3r$rHZout_blobrrr r>s  z&ShuffleNetV2Builder.add_detection_unitc CsRtj|j||||ddifd}tj|j||d||j|jd}tj|j||}|S)Nr&r")r$r#rI)rJr)rr)rrKrrZrelu)rrblobr1r3rrr r@s  z"ShuffleNetV2Builder.add_conv1x1_bnc CsHtj|j||||ddif||dd }tj|j||d||j|jd}|S)Nrr"r&)r$r#r%r=rHrI)rJr)rr)rrKrr)rrrLZchannelsr%rrr r?s   z$ShuffleNetV2Builder.add_dwconv3x3_bnN)r r FFr)r )r&)rr&) __name__ __module__ __qualname__r!r6r-r/r>r@r?rrrr r s # !   r NFc CsRt|||||d}|j|r$|jS|dk rN|j|j|gddg\}} || fSdS)N)rsoftmaxloss)r r6r0ZSoftmaxWithLoss) rrrrlabelrZno_lossZbuilderrPrQrrr create_shufflenets rS)NFF)Z caffe2.pythonrrr rSrrrr s