def model(self):
    x = tf.reshape(self.X, shape=[(- 1), self.image_height, self.image_width, 1])
    print('>>> input x: {}'.format(x))
    wc1 = tf.get_variable(name='wc1', shape=[3, 3, 1, 32], dtype=tf.float32, initializer=tf.contrib.layers.xavier_initializer())
    bc1 = tf.Variable((self.b_alpha * tf.random_normal([32])))
    conv1 = tf.nn.relu(tf.nn.bias_add(tf.nn.conv2d(x, wc1, strides=[1, 1, 1, 1], padding='SAME'), bc1))
    conv1 = tf.nn.max_pool(conv1, ksize=[1, 2, 2, 1], strides=[1, 2, 2, 1], padding='SAME')
    conv1 = tf.nn.dropout(conv1, self.keep_prob)
    wc2 = tf.get_variable(name='wc2', shape=[3, 3, 32, 64], dtype=tf.float32, initializer=tf.contrib.layers.xavier_initializer())
    bc2 = tf.Variable((self.b_alpha * tf.random_normal([64])))
    conv2 = tf.nn.relu(tf.nn.bias_add(tf.nn.conv2d(conv1, wc2, strides=[1, 1, 1, 1], padding='SAME'), bc2))
    conv2 = tf.nn.max_pool(conv2, ksize=[1, 2, 2, 1], strides=[1, 2, 2, 1], padding='SAME')
    conv2 = tf.nn.dropout(conv2, self.keep_prob)
    wc3 = tf.get_variable(name='wc3', shape=[3, 3, 64, 128], dtype=tf.float32, initializer=tf.contrib.layers.xavier_initializer())
    bc3 = tf.Variable((self.b_alpha * tf.random_normal([128])))
    conv3 = tf.nn.relu(tf.nn.bias_add(tf.nn.conv2d(conv2, wc3, strides=[1, 1, 1, 1], padding='SAME'), bc3))
    conv3 = tf.nn.max_pool(conv3, ksize=[1, 2, 2, 1], strides=[1, 2, 2, 1], padding='SAME')
    conv3 = tf.nn.dropout(conv3, self.keep_prob)
    print('>>> convolution 3: ', conv3.shape)
    next_shape = ((conv3.shape[1] * conv3.shape[2]) * conv3.shape[3])
    wd1 = tf.get_variable(name='wd1', shape=[next_shape, 1024], dtype=tf.float32, initializer=tf.contrib.layers.xavier_initializer())
    bd1 = tf.Variable((self.b_alpha * tf.random_normal([1024])))
    dense = tf.reshape(conv3, [(- 1), wd1.get_shape().as_list()[0]])
    dense = tf.nn.relu(tf.add(tf.matmul(dense, wd1), bd1))
    dense = tf.nn.dropout(dense, self.keep_prob)
    wout = tf.get_variable('name', shape=[1024, (self.max_captcha * self.char_set_len)], dtype=tf.float32, initializer=tf.contrib.layers.xavier_initializer())
    bout = tf.Variable((self.b_alpha * tf.random_normal([(self.max_captcha * self.char_set_len)])))
    y_predict = tf.add(tf.matmul(dense, wout), bout)
    return y_predict
def model(self):
    x = tf.reshape(self.X, shape=[(- 1), self.image_height, self.image_width, 1])
    print('>>> input x: {}'.format(x))
    wc1 = tf.get_variable(name='wc1', shape=[3, 3, 1, 32], dtype=tf.float32, initializer=tf.contrib.layers.xavier_initializer())
    bc1 = tf.Variable((self.b_alpha * tf.random_normal([32])))
    conv1 = tf.nn.relu(tf.nn.bias_add(tf.nn.conv2d(x, wc1, strides=[1, 1, 1, 1], padding='SAME'), bc1))
    conv1 = tf.nn.max_pool(conv1, ksize=[1, 2, 2, 1], strides=[1, 2, 2, 1], padding='SAME')
    conv1 = tf.nn.dropout(conv1, self.keep_prob)
    wc2 = tf.get_variable(name='wc2', shape=[3, 3, 32, 64], dtype=tf.float32, initializer=tf.contrib.layers.xavier_initializer())
    bc2 = tf.Variable((self.b_alpha * tf.random_normal([64])))
    conv2 = tf.nn.relu(tf.nn.bias_add(tf.nn.conv2d(conv1, wc2, strides=[1, 1, 1, 1], padding='SAME'), bc2))
    conv2 = tf.nn.max_pool(conv2, ksize=[1, 2, 2, 1], strides=[1, 2, 2, 1], padding='SAME')
    conv2 = tf.nn.dropout(conv2, self.keep_prob)
    wc3 = tf.get_variable(name='wc3', shape=[3, 3, 64, 128], dtype=tf.float32, initializer=tf.contrib.layers.xavier_initializer())
    bc3 = tf.Variable((self.b_alpha * tf.random_normal([128])))
    conv3 = tf.nn.relu(tf.nn.bias_add(tf.nn.conv2d(conv2, wc3, strides=[1, 1, 1, 1], padding='SAME'), bc3))
    conv3 = tf.nn.max_pool(conv3, ksize=[1, 2, 2, 1], strides=[1, 2, 2, 1], padding='SAME')
    conv3 = tf.nn.dropout(conv3, self.keep_prob)
    print('>>> convolution 3: ', conv3.shape)
    next_shape = ((conv3.shape[1] * conv3.shape[2]) * conv3.shape[3])
    wd1 = tf.get_variable(name='wd1', shape=[next_shape, 1024], dtype=tf.float32, initializer=tf.contrib.layers.xavier_initializer())
    bd1 = tf.Variable((self.b_alpha * tf.random_normal([1024])))
    dense = tf.reshape(conv3, [(- 1), wd1.get_shape().as_list()[0]])
    dense = tf.nn.relu(tf.add(tf.matmul(dense, wd1), bd1))
    dense = tf.nn.dropout(dense, self.keep_prob)
    wout = tf.get_variable('name', shape=[1024, (self.max_captcha * self.char_set_len)], dtype=tf.float32, initializer=tf.contrib.layers.xavier_initializer())
    bout = tf.Variable((self.b_alpha * tf.random_normal([(self.max_captcha * self.char_set_len)])))
    y_predict = tf.add(tf.matmul(dense, wout), bout)
    return y_predict