示例#1
0
文件: unpool2d.py 项目: yygr/ReNom
 def forward(self, x, index=None):
     size_i = x.shape[1:]
     size_o = [
         size_i[0],
     ]
     size_o.extend(
         transpose_out_size(size_i[1:], self._kernel, self._stride,
                            self._padding))
     return max_unpool2d(x, index, size_i, size_o, self._kernel,
                         self._stride, self._padding)
示例#2
0
文件: unpool2d.py 项目: yygr/ReNom
 def __new__(cls, x, index, filter, stride, padding):
     filter, stride, padding = (tuplize(x)
                                for x in (filter, stride, padding))
     in_shape = x.shape[1:]
     out_shape = [
         x.shape[1],
     ]
     out_shape.extend(
         transpose_out_size(in_shape[1:], filter, stride, padding))
     return cls.calc_value(x, index, in_shape, out_shape, filter, stride,
                           padding)
示例#3
0
    def __new__(cls, x, w, b, filter=3, stride=1, padding=0, dilation=1):
        filter, stride, padding, dilation = (tuplize(x)
                                             for x in (filter, stride, padding,
                                                       dilation))

        in_shape = x.shape[1:]
        out_shape = [
            w.shape[1],
        ]
        out_shape.extend(
            transpose_out_size(in_shape[1:], filter, stride, padding,
                               dilation))
        return cls.calc_value(x, w, b, in_shape, out_shape, filter, stride,
                              padding, dilation)