import tensorflow as tf

        # Select logits to prob function
        self.logits_to_prob = tf.nn.softmax
        if self.hparams.logits_to_prob == 'sigmoid':
            self.logits_to_prob = sigmoid_prob

        self.output = self.ranking_model(self.max_candidate_num, scope='ranking_model')
        pad_removed_output = self.remove_padding_for_metric_eval(self.docid_inputs, self.output)
        reshaped_labels = tf.transpose(tf.convert_to_tensor(self.labels)) # reshape from [max_candidate_num, ?] to [?, max_candidate_num]
        
        for metric in self.exp_settings['metrics']:
            for topn in self.exp_settings['metrics_topn']:
                metric_value = utils.make_ranking_metric_fn(metric, topn)(reshaped_labels, pad_removed_output, None)
                tf.summary.scalar('%s_%d' % (metric, topn), metric_value, collections=['eval'])

        if not forward_only:
            # Build model
            self.rank_list_size = exp_settings['train_list_cutoff']
            train_output = self.ranking_model(self.rank_list_size, scope='ranking_model')
            self.propensity = self.DenoisingNet(self.rank_list_size, forward_only)
            train_labels = self.labels[:self.rank_list_size]

            print('Loss Function is ' + self.hparams.loss_func)
            # Select loss function
            self.loss_func = None
