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(ConvConnection, self).__init__(params) self.conv_params = params.convolution_param self.convolver = co.Convolver(self.conv_params.pad, self.conv_params.pad, self.conv_params.stride, self.conv_params.stride)
def __init__(self, params): super(ConvConnection, self).__init__(params) self.conv_params = params.convolution_param self.convolver = co.Convolver(self.conv_params.pad, self.conv_params.pad, self.conv_params.stride, self.conv_params.stride) self.convolution_param = params.convolution_param self.num_output = params.convolution_param.num_output self.group = params.convolution_param.group #TODO: hack, we don't want to slice agian to use it into bp as a parameter self.group_data = [] self.group_filter = [] self.group_bias = []
import owl import owl.conv as co import numpy as np import demo_common x = owl.randn([227, 227, 3, 256], 0.0, 1) w = owl.randn([11, 11, 3, 96], 0.0, 0.1) b = owl.zeros([96]) conv = co.Convolver(pad_h=0, pad_w=0, stride_v=4, stride_h=4) y = conv.ff(x, w, b) print y.to_numpy() print y.shape ex = conv.bp(y, w) print ex.to_numpy() print ex.shape