def __init__(self): self.convs = [ conv.Convolver(0, 0, 1, 1), conv.Convolver(2, 2, 1, 1), ] self.poolings = [ conv.Pooler(2, 2, 2, 2, 0, 0, conv.pool_op.max), conv.Pooler(3, 3, 3, 3, 0, 0, conv.pool_op.max) ]
def __init__(self): self.convs = [ co.Convolver(0, 0, 4, 4), # conv1 co.Convolver(2, 2, 1, 1), # conv2 co.Convolver(1, 1, 1, 1), # conv3 co.Convolver(1, 1, 1, 1), # conv4 co.Convolver(1, 1, 1, 1) # conv5 ] self.poolings = [ co.Pooler(3, 3, 2, 2, co.pool_op.max), # pool1 co.Pooler(3, 3, 2, 2, co.pool_op.max), # pool2 co.Pooler(3, 3, 2, 2, co.pool_op.max) # pool5 ]
def __init__(self, params): super(PoolingUnit, self).__init__(params) ppa = params.pooling_param if ppa.pool == PoolingParameter.PoolMethod.Value('MAX'): pool_ty = co.pool_op.max elif ppa.pool == PoolingParameter.PoolMethod.Value('AVE'): pool_ty = co.pool_op.avg self.pooler = co.Pooler(ppa.kernel_size, ppa.kernel_size, ppa.stride, ppa.stride, ppa.pad, ppa.pad, pool_ty)