WongKinYiu / CrossStagePartialNetworks

Cross Stage Partial Networks
https://github.com/WongKinYiu/CrossStagePartialNetworks
894 stars 172 forks source link

how to split the feature in two #18

Open EtheneXiang opened 4 years ago

EtheneXiang commented 4 years ago

image how to split the feature in two in your paper i see, the frist feture map was splitted in two, one for concat, and another for conv and copy. But I didn't find any relevant information in your train cfg file: csresnext50-panet-spp-original-optimal.cfg @WongKinYiu @AlexeyAB

WongKinYiu commented 4 years ago

There are two equivalent implementation.

  1. separate it to two convolution
    
    # 1-1
    [convolutional]
    batch_normalize=1
    filters=64
    size=1
    stride=1
    pad=1
    activation=leaky

[route] layers = -2

1-2

[convolutional] batch_normalize=1 filters=64 size=1 stride=1 pad=1 activation=leaky


2. split one convolution into two parts

[convolutional] batch_normalize=1 filters=128 size=1 stride=1 pad=1 activation=leaky

1-1

[route] layers = -1 group_id=0 groups=2

1-2

[route] layers = -2 group_id=1 groups=2



Our old cfg use the first implementation, and new cfg use the second implementation.
Very thanks @AlexeyAB for supporting the second implementation.
EtheneXiang commented 4 years ago

@WongKinYiu thanks but I think you said is this condition: image

but what i mean and what i want is this : image

after 1x1x128 conv image

the out feature map is nxnx128, and i want split the 128-feature in two, one half for OpreationA, and another half for OpreationB

WongKinYiu commented 4 years ago

Hello, the second case is what you want.

[convolutional]
batch_normalize=1
filters=128
size=1
stride=1
pad=1
activation=leaky

# 1-1
[route]
layers = -1
group_id=0
groups=2

# 1-2
[route]
layers = -2
group_id=1
groups=2

The parameter groups=2 means separate 128 to 64/64.

EtheneXiang commented 4 years ago

oh really?, it's great. but i do not find this uasge in your or AlexeyAB's github, i cheacked the cfg file just now. can you show me some example cfg aobut the the second case? thanks very much

WongKinYiu commented 4 years ago

@EtheneXiang Hello,

This is an example https://github.com/WongKinYiu/CrossStagePartialNetworks/blob/master/cfg/csresnext50-elastic.cfg#L65

EtheneXiang commented 4 years ago

thank you and i have another porblem, do you have tools to visualize the cfg. It's troublesome to red with text editor such as vim in linux or notepad++ in windows.

WongKinYiu commented 4 years ago

no, i usually draw the architecture by myself.

EtheneXiang commented 4 years ago

image OK Anyway, thank you very much

AlexeyAB commented 4 years ago

@EtheneXiang

and i have another porblem, do you have tools to visualize the cfg.

You can try: https://github.com/lutzroeder/netron

syjeon121 commented 4 years ago

@WongKinYiu hi, thanks for your explanation but i am still confused about separate feature map

There are two equivalent implementation.

  1. separate it to two convolution
    
    # 1-1
    [convolutional]
    batch_normalize=1
    filters=64
    size=1
    stride=1
    pad=1
    activation=leaky

[route] layers = -2

1-2

[convolutional] batch_normalize=1 filters=64 size=1 stride=1 pad=1 activation=leaky

2. split one convolution into two parts

[convolutional] batch_normalize=1 filters=128 size=1 stride=1 pad=1 activation=leaky

1-1

[route] layers = -1 group_id=0 groups=2

1-2

[route] layers = -2 group_id=1 groups=2

as stated in your paper, does the first method divide the feature map into two flow like the second method?

WongKinYiu commented 4 years ago

they are two equivalent implementation of same method.

syjeon121 commented 4 years ago

oh, sorry i made mistake. thank you

WongKinYiu commented 4 years ago

image

abhiagwl4262 commented 3 years ago

@WongKinYiu It seems.. The concept of splitting the input into two parts is exactly same as group convolution ? Please explain If I am wrong.

dengxinlong commented 3 years ago

no, i usually draw the architecture by myself.

Hello, can you tell me what tool you used to draw the architecture. thank you!

brandhsu commented 3 years ago

Hi, I was wondering if the main benefit of splitting the channels in the CSPBlock is computation.