def __init__(self, n_in, n_units, n_out): super(MnistMLP, self).__init__( l1=link_binary_linear.BinaryLinear(n_in, n_units), b1=L.BatchNormalization(n_units), l2=link_binary_linear.BinaryLinear(n_units, n_units), b2=L.BatchNormalization(n_units), l3=link_binary_linear.BinaryLinear(n_units, n_out), b3=L.BatchNormalization(n_out), ) self.train = True
def __init__(self): super(BinaryConnectMnistMLP, self).__init__() with self.init_scope(): self.bfc0 = link_binary_linear.BinaryLinear(784, 2048) self.bn0 = L.BatchNormalization(2048) self.bfc1 = link_binary_linear.BinaryLinear(2048, 2048) self.bn1 = L.BatchNormalization(2048) self.bfc2 = link_binary_linear.BinaryLinear(2048, 2048) self.bn2 = L.BatchNormalization(2048) self.bfc3 = link_binary_linear.BinaryLinear(2048, 10) self.bn3 = L.BatchNormalization(10)
def __init__(self): super(Cifar10CNN, self).__init__( c1=link_binary_convolution.BinaryConvolution2D(3, 32, 5), b1=L.BatchNormalization(32), c2=link_binary_convolution.BinaryConvolution2D(32, 64, 5), b2=L.BatchNormalization(64), c3=link_binary_convolution.BinaryConvolution2D(64, 128, 5), b3=L.BatchNormalization(128), l1=link_binary_linear.BinaryLinear(128 * 20 * 20, 256), b4=L.BatchNormalization(256), l2=link_binary_linear.BinaryLinear(256, 10), b5=L.BatchNormalization(10)) self.train = True
def __init__(self): super(BinaryConnectMnistLeNet, self).__init__() with self.init_scope(): self.bconv0 = link_binary_convolution.BinaryConvolution2D(1, 64, ksize=5, pad=0, stride=1) self.bn0 = L.BatchNormalization(64) self.bconv1 = link_binary_convolution.BinaryConvolution2D(64, 64, ksize=5, pad=0, stride=1) self.bn1 = L.BatchNormalization(64) self.bfc0 = link_binary_linear.BinaryLinear(1024, 512) self.bn2 = L.BatchNormalization(512) self.bfc1 = link_binary_linear.BinaryLinear(512, 10) self.bn3 = L.BatchNormalization(10)
def __init__(self): super(CNN, self).__init__( conv0=L.Convolution2D(3,64,7, stride=2, pad=3, nobias=True), b_conv0=L.BatchNormalization(64), block0=RB.BlockStack(3,64,64,decre_ratio=4, kernel=(1,3,1), stride=(1,2,1), pad=(0,0,0),nobias=True), b_block0=L.BatchNormalization(64), conv1=IC.Convolution2D(64,128,3, stride=1, pad=1, nobias=True), b_conv1=L.BatchNormalization(128), block1=RB.BlockStack(3,128,128,decre_ratio=4, kernel=(1,3,1), stride=(1,2,1), pad=(0,0,0),nobias=True), b_block1=L.BatchNormalization(128), conv2=IC.Convolution2D(128,256,3, stride=1, pad=1, nobias=True), b_conv2=L.BatchNormalization(256), block2=RB.BlockStack(3,256,256,decre_ratio=4, kernel=(1,3,1), stride=(1,2,1), pad=(0,0,0),nobias=True), b_block2=L.BatchNormalization(256), conv3=IC.Convolution2D(256,512,3, stride=1, pad=1, nobias=True), b_conv3=L.BatchNormalization(512), block3=RB.BlockStack(3,512,512,decre_ratio=4, kernel=(1,3,1), stride=(1,2,1), pad=(0,0,0),nobias=True), b_block3=L.BatchNormalization(512), conv4=IC.Convolution2D(512,1024,3, stride=1, pad=1, nobias=True), b_conv4=L.BatchNormalization(1024), fc0=BL.BinaryLinear(4096,10), b_dense0=L.BatchNormalization(10) )
def __init__(self): super(CNN, self).__init__(conv0=IC.Convolution2D(3, 64, 3, stride=1, pad=1, nobias=True), b0=LBN.BatchNormalization(64), conv1=BC.Convolution2D(64, 128, 3, stride=1, pad=1, nobias=True), b1=LBN.BatchNormalization(128), conv2=BC.Convolution2D(128, 128, 3, stride=1, pad=1, nobias=True), b2=LBN.BatchNormalization(128), fc0=BL.BinaryLinear(128, 3), b3=LBN.BatchNormalization(3))