Beispiel #1
0
 def __init__(self, n_in, n_out):
     super(AlexNet, self).__init__()
     self.n_out = n_out
     with self.init_scope():
         self.conv1 = BL.ConvPoolBNBST(n_in,
                                       10,
                                       5,
                                       stride=1,
                                       pad=0,
                                       pksize=3,
                                       pstride=2)
         self.conv2 = BL.BinaryConvPoolBNBST(10,
                                             10,
                                             5,
                                             stride=1,
                                             pad=2,
                                             pksize=3,
                                             pstride=2)
         self.conv3 = BL.BinaryConvBNBST(10, 10, 3, stride=1, pad=1)
         self.conv4 = BL.BinaryConvBNBST(10, 10, 3, stride=1, pad=1)
         self.conv5 = BL.BinaryConvPoolBNBST(10,
                                             10,
                                             3,
                                             stride=1,
                                             pad=1,
                                             pksize=3,
                                             pstride=2)
         self.fc8 = BL.BinaryLinearBNSoftmax(40, n_out)
Beispiel #2
0
 def __init__(self, n_filters, n_out):
     super(ConvNet, self).__init__()
     self.n_filters = n_filters
     self.n_out = n_out
     with self.init_scope():
         self.l1 = BL.ConvPoolBNBST(1,
                                    n_filters,
                                    3,
                                    stride=2,
                                    pksize=3,
                                    pstride=2)
         self.l2 = BL.BinaryLinearBNSoftmax(360, n_out)
Beispiel #3
0
 def __init__(self, n_in, n_out, n_filters):
     super(ConvNet, self).__init__()
     self.n_in = n_in
     self.n_out = n_out
     self.n_filters = n_filters
     with self.init_scope():
         self.l1 = BL.ConvPoolBNBST(n_in,
                                    n_filters,
                                    3,
                                    stride=2,
                                    pksize=3,
                                    pstride=2)
         self.l2 = BL.BinaryLinearBNSoftmax(None, n_out)
Beispiel #4
0
    def __init__(self, n_filters, n_out):
        super(ConvNet, self).__init__()
        self.n_filters = n_filters
        self.n_out = n_out
        with self.init_scope():
            print '(net.py)-init ConvNet'
            # if the number of intermediate output(3) increase, the accuracy will increase as well
            self.l1 = BL.ConvPoolBNBST(n_filters, 3)
            print ' self.l1 is ', self.l1
            # we can also try
            # self.l1 = BL.BinaryConvBNBST(n_filters, 3)

            # Softmax is more computational expensive
            self.l2 = BL.BinaryLinearBNSoftmax(n_out)
            print ' self.l2 is ', self.l2