def init_gene_with_conv(self):
    arch = ['S_ConvBlock_64_3']
    input_layer_num = (int((self.net_info.input_num / self.net_info.rows)) + 1)
    output_layer_num = (int((self.net_info.out_num / self.net_info.rows)) + 1)
    layer_ids = [(((((self.net_info.cols - 1) - input_layer_num) - output_layer_num) + i) // len(arch)) for i in range(len(arch))]
    prev_id = 0
    current_layer = input_layer_num
    block_ids = []
    for (i, idx) in enumerate(layer_ids):
        current_layer += idx
        n = ((current_layer * self.net_info.rows) + np.random.randint(self.net_info.rows))
        block_ids.append(n)
        self.gene[n][0] = self.net_info.func_type.index(arch[i])
        col = np.min((int((n / self.net_info.rows)), self.net_info.cols))
        max_connect_id = ((col * self.net_info.rows) + self.net_info.input_num)
        min_connect_id = ((((col - self.net_info.level_back) * self.net_info.rows) + self.net_info.input_num) if ((col - self.net_info.level_back) >= 0) else 0)
        self.gene[n][1] = prev_id
        for j in range(1, self.net_info.max_in_num):
            self.gene[n][(j + 1)] = (min_connect_id + np.random.randint((max_connect_id - min_connect_id)))
        prev_id = (n + self.net_info.input_num)
    n = self.net_info.node_num
    type_num = (self.net_info.func_type_num if (n < self.net_info.node_num) else self.net_info.out_type_num)
    self.gene[n][0] = np.random.randint(type_num)
    col = np.min((int((n / self.net_info.rows)), self.net_info.cols))
    max_connect_id = ((col * self.net_info.rows) + self.net_info.input_num)
    min_connect_id = ((((col - self.net_info.level_back) * self.net_info.rows) + self.net_info.input_num) if ((col - self.net_info.level_back) >= 0) else 0)
    self.gene[n][1] = prev_id
    for i in range(1, self.net_info.max_in_num):
        self.gene[n][(i + 1)] = (min_connect_id + np.random.randint((max_connect_id - min_connect_id)))
    block_ids.append(n)
    for n in range((self.net_info.node_num + self.net_info.out_num)):
        if (n in block_ids):
            continue
        type_num = (self.net_info.func_type_num if (n < self.net_info.node_num) else self.net_info.out_type_num)
        self.gene[n][0] = np.random.randint(type_num)
        col = np.min((int((n / self.net_info.rows)), self.net_info.cols))
        max_connect_id = ((col * self.net_info.rows) + self.net_info.input_num)
        min_connect_id = ((((col - self.net_info.level_back) * self.net_info.rows) + self.net_info.input_num) if ((col - self.net_info.level_back) >= 0) else 0)
        for i in range(self.net_info.max_in_num):
            self.gene[n][(i + 1)] = (min_connect_id + np.random.randint((max_connect_id - min_connect_id)))
    self.check_active()
def init_gene_with_conv(self):
    arch = ['S_ConvBlock_64_3']
    input_layer_num = (int((self.net_info.input_num / self.net_info.rows)) + 1)
    output_layer_num = (int((self.net_info.out_num / self.net_info.rows)) + 1)
    layer_ids = [(((((self.net_info.cols - 1) - input_layer_num) - output_layer_num) + i) // len(arch)) for i in range(len(arch))]
    prev_id = 0
    current_layer = input_layer_num
    block_ids = []
    for (i, idx) in enumerate(layer_ids):
        current_layer += idx
        n = ((current_layer * self.net_info.rows) + np.random.randint(self.net_info.rows))
        block_ids.append(n)
        self.gene[n][0] = self.net_info.func_type.index(arch[i])
        col = np.min((int((n / self.net_info.rows)), self.net_info.cols))
        max_connect_id = ((col * self.net_info.rows) + self.net_info.input_num)
        min_connect_id = ((((col - self.net_info.level_back) * self.net_info.rows) + self.net_info.input_num) if ((col - self.net_info.level_back) >= 0) else 0)
        self.gene[n][1] = prev_id
        for j in range(1, self.net_info.max_in_num):
            self.gene[n][(j + 1)] = (min_connect_id + np.random.randint((max_connect_id - min_connect_id)))
        prev_id = (n + self.net_info.input_num)
    n = self.net_info.node_num
    type_num = (self.net_info.func_type_num if (n < self.net_info.node_num) else self.net_info.out_type_num)
    self.gene[n][0] = np.random.randint(type_num)
    col = np.min((int((n / self.net_info.rows)), self.net_info.cols))
    max_connect_id = ((col * self.net_info.rows) + self.net_info.input_num)
    min_connect_id = ((((col - self.net_info.level_back) * self.net_info.rows) + self.net_info.input_num) if ((col - self.net_info.level_back) >= 0) else 0)
    self.gene[n][1] = prev_id
    for i in range(1, self.net_info.max_in_num):
        self.gene[n][(i + 1)] = (min_connect_id + np.random.randint((max_connect_id - min_connect_id)))
    block_ids.append(n)
    for n in range((self.net_info.node_num + self.net_info.out_num)):
        if (n in block_ids):
            continue
        type_num = (self.net_info.func_type_num if (n < self.net_info.node_num) else self.net_info.out_type_num)
        self.gene[n][0] = np.random.randint(type_num)
        col = np.min((int((n / self.net_info.rows)), self.net_info.cols))
        max_connect_id = ((col * self.net_info.rows) + self.net_info.input_num)
        min_connect_id = ((((col - self.net_info.level_back) * self.net_info.rows) + self.net_info.input_num) if ((col - self.net_info.level_back) >= 0) else 0)
        for i in range(self.net_info.max_in_num):
            self.gene[n][(i + 1)] = (min_connect_id + np.random.randint((max_connect_id - min_connect_id)))
    self.check_active()