CNN.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:AttentionNet 作者: sayvazov 项目源码 文件源码
def eval(self, inp):
        #input = self.pad(inp.eval())
        results= theano.tensor.nnet.conv2d(input, self.W, border_mode='full' )
        biased = results + self.b.dimshuffle('x', 0, 'x', 'x')
        result = theano.tensor.nnet.sigmoid(biased)
        return result







#test = CNNlayer((1,1,4,4), (1,1,3,3))
#inp = np.array([[0.0,0,0,0],[0,1,0,0], [0,0,0,0], [0,0,0,0]])
#weight = np.array([[1,.2, 0],[.4,.5, 0], [0,0,0]])
#test.setW(weight)
#weight_2 = np.array([list(weight[i][::-1]) for i in range(len(weight))])
#weight_3 = weight_2[::-1]
#print(inp)
#print(( weight_3))
#print("their", conv.conv2d(inp, weight).eval())
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号