コード例 #1
0
ファイル: generator.py プロジェクト: ygoddard/AutoDLProject
 def __init__(self, n_output_node, input_shape):
     super(MobileNetV2Generator, self).__init__(n_output_node, input_shape)
       
     """ configuration for complete net:
     self.cfg = [(1,  16, 1, 1),
        (6,  24, 2, 1) ,  # NOTE: change stride 2 -> 1 for CIFAR10
        (6,  32, 3, 2),
        (6,  64, 4, 2),
        (6,  96, 3, 1),
        (6, 160, 3, 2),
        (6, 320, 1, 1)]
     """
     
     # we try smaller net configuration (so autokeras will be able to expand the net)
     self.cfg = [(1,  16, 1, 1),
        (6,  24, 2, 1)] # ,  # NOTE: change stride 2 -> 1 for CIFAR10
        #(6,  32, 3, 2) ,
        #(6,  64, 4, 2),
        #(6,  96, 3, 1),
        #(6, 160, 3, 2),
        #(6, 320, 1, 1)]
     
     self.in_planes = 32
     self.block_expansion = 1
     self.n_dim = len(self.input_shape) - 1
     
     if len(self.input_shape) > 4:
         raise ValueError('The input dimension is too high.')
     elif len(self.input_shape) < 2:
         raise ValueError('The input dimension is too low.')
     self.conv = get_conv_class(self.n_dim)
     self.dropout = get_dropout_class(self.n_dim)
     self.global_avg_pooling = get_global_avg_pooling_class(self.n_dim)
     self.adaptive_avg_pooling = get_global_avg_pooling_class(self.n_dim)
     self.batch_norm = get_batch_norm_class(self.n_dim)
コード例 #2
0
 def __init__(self, n_output_node, input_shape):
     super(ResNetGenerator, self).__init__(n_output_node, input_shape)
     # self.layers = [2, 2, 2, 2]
     self.in_planes = 64
     self.block_expansion = 1
     self.n_dim = len(self.input_shape) - 1
     if len(self.input_shape) > 4:
         raise ValueError('The input dimension is too high.')
     elif len(self.input_shape) < 2:
         raise ValueError('The input dimension is too low.')
     self.conv = get_conv_class(self.n_dim)
     self.dropout = get_dropout_class(self.n_dim)
     self.global_avg_pooling = get_global_avg_pooling_class(self.n_dim)
     self.adaptive_avg_pooling = get_global_avg_pooling_class(self.n_dim)
     self.batch_norm = get_batch_norm_class(self.n_dim)
コード例 #3
0
 def __init__(self, n_output_node, input_shape):
     super().__init__(n_output_node, input_shape)
     # DenseNet Constant
     self.num_init_features = 64
     self.growth_rate = 32
     self.block_config = (6, 12, 24, 16)
     self.bn_size = 4
     self.drop_rate = 0
     # Stub layers
     self.n_dim = len(self.input_shape) - 1
     self.conv = get_conv_class(self.n_dim)
     self.dropout = get_dropout_class(self.n_dim)
     self.global_avg_pooling = get_global_avg_pooling_class(self.n_dim)
     self.adaptive_avg_pooling = get_global_avg_pooling_class(self.n_dim)
     self.max_pooling = get_pooling_class(self.n_dim)
     self.avg_pooling = get_avg_pooling_class(self.n_dim)
     self.batch_norm = get_batch_norm_class(self.n_dim)
コード例 #4
0
ファイル: generator.py プロジェクト: wpsliu123/AUTOKERAS
 def __init__(self, n_output_node, input_shape):
     super(CnnGenerator, self).__init__(n_output_node, input_shape)
     self.n_dim = len(self.input_shape) - 1
     if len(self.input_shape) > 4:
         raise ValueError('The input dimension is too high.')
     if len(self.input_shape) < 2:
         raise ValueError('The input dimension is too low.')
     self.conv = get_conv_class(self.n_dim)
     self.dropout = get_dropout_class(self.n_dim)
     self.global_avg_pooling = get_global_avg_pooling_class(self.n_dim)
     self.pooling = get_pooling_class(self.n_dim)
     self.batch_norm = get_batch_norm_class(self.n_dim)
コード例 #5
0
ファイル: generator.py プロジェクト: etignone/autokeras
    def __init__(self, n_output_node, input_shape):
        """Initialize the instance.

        Args:
            n_output_node: An integer. Number of output nodes in the network.
            input_shape: A tuple. Input shape of the network.
        """
        super(CnnGenerator, self).__init__(n_output_node, input_shape)
        self.n_dim = len(self.input_shape) - 1
        if len(self.input_shape) > 4:
            raise ValueError('The input dimension is too high.')
        if len(self.input_shape) < 2:
            raise ValueError('The input dimension is too low.')
        self.conv = get_conv_class(self.n_dim)
        self.dropout = get_dropout_class(self.n_dim)
        self.global_avg_pooling = get_global_avg_pooling_class(self.n_dim)
        self.pooling = get_pooling_class(self.n_dim)
        self.batch_norm = get_batch_norm_class(self.n_dim)
コード例 #6
0
ファイル: generator.py プロジェクト: Saiuz/autokeras
    def __init__(self, n_output_node, input_shape):
        """Initialize the instance.

        Args:
            n_output_node: An integer. Number of output nodes in the network.
            input_shape: A tuple. Input shape of the network.
        """
        super(CnnGenerator, self).__init__(n_output_node, input_shape)
        self.n_dim = len(self.input_shape) - 1
        if len(self.input_shape) > 4:
            raise ValueError('The input dimension is too high.')
        if len(self.input_shape) < 2:
            raise ValueError('The input dimension is too low.')
        self.conv = get_conv_class(self.n_dim)
        self.dropout = get_dropout_class(self.n_dim)
        self.global_avg_pooling = get_global_avg_pooling_class(self.n_dim)
        self.pooling = get_pooling_class(self.n_dim)
        self.batch_norm = get_batch_norm_class(self.n_dim)