'Model - wide and deep - built using tflearn'

def build_model(self, learning_rate=[0.001, 0.01]):

    n_cc = len(self.continuous_columns)
    n_categories = 1
    input_shape = [None, n_cc]
    if self.verbose:
        print((('=' * 77) + ('    Model    %s    (type=%s)' % (self.name, self.model_type))))
        print(('        Input    placeholder    shape=%s' % str(input_shape)))
    wide_inputs = tflearn.input_data(shape=input_shape, name='wide_X')
    if (not isinstance(learning_rate, list)):
        learning_rate = [learning_rate, learning_rate]
    if self.verbose:
        print(('        Learning    rates    (wide,    deep)=%s' % learning_rate))
    with tf.name_scope('Y'):
        Y_in = tf.placeholder(shape=[None, 1], dtype=tf.float32, name='Y')
    with tf.variable_scope(None, 'cb_unit', [wide_inputs]) as scope:
        central_bias = tflearn.variables.variable('central_bias', shape=[1], initializer=tf.constant_initializer(np.random.randn()), trainable=True, restore=True)
        tf.add_to_collection((tf.GraphKeys.LAYER_VARIABLES + '/cb_unit'), central_bias)
    if ('wide' in self.model_type):
        wide_network = self.wide_model(wide_inputs, n_cc)
        network = wide_network
        wide_network_with_bias = tf.add(wide_network, central_bias, name='wide_with_bias')
    if ('deep' in self.model_type):
        deep_network = self.deep_model(wide_inputs, n_cc)
        deep_network_with_bias = tf.add(deep_network, central_bias, name='deep_with_bias')
        if ('wide' in self.model_type):
            network = tf.add(wide_network, deep_network)
            if self.verbose:
                print(('Wide    +    deep    model    network    %s' % network))
        else:
            network = deep_network
    network = tf.add(network, central_bias, name='add_central_bias')
    with tf.name_scope('Monitors'):
        predictions = tf.cast(tf.greater(network, 0), tf.int64)
        print(('predictions=%s' % predictions))
        Ybool = tf.cast(Y_in, tf.bool)
        print(('Ybool=%s' % Ybool))
        pos = tf.boolean_mask(predictions, Ybool)
        neg = tf.boolean_mask(predictions, (~ Ybool))
        psize = tf.cast(tf.shape(pos)[0], tf.int64)
        nsize = tf.cast(tf.shape(neg)[0], tf.int64)
        true_positive = tf.reduce_sum(pos, name='true_positive')
        false_negative = tf.subtract(psize, true_positive, name='false_negative')
        false_positive = tf.reduce_sum(neg, name='false_positive')
        true_negative = tf.subtract(nsize, false_positive, name='true_negative')
        overall_accuracy = tf.truediv(tf.add(true_positive, true_negative), tf.add(nsize, psize), name='overall_accuracy')
    vmset = [true_positive, true_negative, false_positive, false_negative, overall_accuracy]
    trainable_vars = tf.trainable_variables()
    tv_deep = [v for v in trainable_vars if v.name.startswith('deep_')]
    tv_wide = [v for v in trainable_vars if v.name.startswith('wide_')]
    if self.verbose:
        print('DEEP    trainable_vars')
        for v in tv_deep:
            print(('        Variable    %s:    %s' % (v.name, v)))
        print('WIDE    trainable_vars')
        for v in tv_wide:
            print(('        Variable    %s:    %s' % (v.name, v)))
    if ('wide' in self.model_type):
        if (not ('deep' in self.model_type)):
            tv_wide.append(central_bias)
        tflearn.regression(wide_network_with_bias, placeholder=Y_in, optimizer='sgd', loss='binary_crossentropy', metric='accuracy', learning_rate=learning_rate[0], validation_monitors=vmset, trainable_vars=tv_wide, op_name='wide_regression', name='Y')
    if ('deep' in self.model_type):
        if (not ('wide' in self.model_type)):
            tv_wide.append(central_bias)
        tflearn.regression(deep_network_with_bias, placeholder=Y_in, optimizer='adam', loss='binary_crossentropy', metric='accuracy', learning_rate=learning_rate[1], validation_monitors=(vmset if (not ('wide' in self.model_type)) else None), trainable_vars=tv_deep, op_name='deep_regression', name='Y')
    if (self.model_type == 'wide+deep'):
        tflearn.regression(network, placeholder=Y_in, optimizer='adam', loss='binary_crossentropy', metric='accuracy', learning_rate=learning_rate[0], trainable_vars=[central_bias], op_name='central_bias_regression', name='Y')
    self.model = tflearn.DNN(network, tensorboard_verbose=self.tensorboard_verbose, max_checkpoints=5, checkpoint_path=('%s/%s.tfl' % (self.checkpoints_dir, self.name)))
    if self.verbose:
        print('Target    variables:')
        for v in tf.get_collection(tf.GraphKeys.TARGETS):
            print(('        variable    %s:    %s' % (v.name, v)))
        print(('=' * 77))
