import tensorflow as tf

    indicator = tf.less(range_tiled, lengths_tiled+1) #i.e. where seq len is less than index
    trim = np.ones(indicator.get_shape())
    trim[:,0] = 0 #ignore start symbol
    indicator = tf.logical_and(indicator, trim.astype(bool))
    self.indicator = indicator

    sz = [batch_size, max_sequence_len]
    self._mask = tf.select(indicator, tf.ones(sz), tf.zeros(sz))

    #-------------------------------#

    self.weights = tf.constant(weights, dtype=tf.float32, name='class_weights')

    hidden_size = model_params['model_hidden_size']
