'Adds a dense linear layer to this model.
Uses Glorot 2010 initialization assuming linear activation.'

def add_dense(self, num_units, stddev_factor=1.0):

    assert (len(self.get_output().get_shape()) == 2), 'Previous    layer    must    be    2-dimensional    (batch,    channels)'
    with tf.variable_scope(self._get_layer_str()):
        prev_units = self._get_num_inputs()
        initw = self._glorot_initializer(prev_units, num_units, stddev_factor=stddev_factor)
        weight = tf.get_variable('weight', initializer=initw)
        initb = tf.constant(0.0, shape=[num_units])
        bias = tf.get_variable('bias', initializer=initb)
        out = (tf.matmul(self.get_output(), weight) + bias)
    self.outputs.append(out)
    return self
