Convolution Layer

Convolution Layer

Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 256000/256000 K (Java/Others)
Total Submission(s): 0    Accepted Submission(s): 0


Problem Description
In Convolutional Neural Networks(CNNs), the convolution layer is the most import component.

The convolution layer have two 4-dimension arrays: IRnumin×channelin×hin×win and WRnumw×channelw×hw×ww , and get a 4-dimension array: ORnumout×channelout×hout×wout , where numout=numin,channelout=numw,hout=(hinhw)/strideh+1,wout=(winww)/stridew+1 , and channelin must be equal to channelw . stridew , strideh is the parameters of CNNs.(We ignore other parameters like pad.)

We can use the following formula to represent a simple convolution layer:
O[n][m][x][y]=c=0channelin1i=0hw1j=0ww1I[n][c][x×strideh+i][y×stridew+j]W[m][c][i][j]
nmxy====0,,numout10,,channelout10,,hout10,,wout1


Today, Xiaoming find a special convolution layer, The value of each element in I and W is either -1 or +1. Please help he compute O .
 

Input
In the first line there are four integers: numin , channelin , hin , win ;
In the second line there are numin×channelin×hin×win integers, represent I . The value of each element in I is -1 or +1.
In the third line there are four integers: numw,channelw,hw,ww .
In the fourth line there are numw×channelw×hw×ww integers, represent W . The value of each element in W is -1 or +1;
In the fifth line there are two integers: strideh , stridew .

Except for the sample,
numin=10,channelin=64,hin=56,win=56
numw=64,channelw=channelin,hw=11,ww=11
strideh=1,stridew=1

 

Output
First, print four integers: numout , channelout , hout , wout in a line.
Then print an integer ansmod232 in a line, so that
ans=n=0numout1m=0channelout1x=0hout1y=0wout1O[n][m][x][y](((nchannelout+m)hout+x)wout+y)

 

Sample Input
  
  
1 1 5 5 -1 1 -1 -1 -1 1 -1 -1 -1 -1 1 -1 -1 1 1 1 1 1 1 -1 -1 -1 -1 -1 -1 1 1 3 3 1 -1 1 -1 1 -1 1 1 -1 1 1
 

Sample Output
  
  
1 1 3 3 4294967286
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值