LearningMachine.py [696:725]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                    logits = self.model(inputs_desc, length_desc, *param_list)

                    logits_softmax = {}
                    if isinstance(self.model, nn.DataParallel):
                        for tmp_output_layer_id in self.model.module.output_layer_id:
                            if isinstance(self.model.module.layers[tmp_output_layer_id], Linear) and \
                                    (not self.model.module.layers[tmp_output_layer_id].layer_conf.last_hidden_softmax):
                                logits_softmax[tmp_output_layer_id] = nn.functional.softmax(
                                    logits[tmp_output_layer_id], dim=-1)
                            else:
                                logits_softmax[tmp_output_layer_id] = logits[tmp_output_layer_id]
                    else:
                        for tmp_output_layer_id in self.model.output_layer_id:
                            if isinstance(self.model.layers[tmp_output_layer_id], Linear) and \
                                    (not self.model.layers[tmp_output_layer_id].layer_conf.last_hidden_softmax):
                                logits_softmax[tmp_output_layer_id] = nn.functional.softmax(
                                    logits[tmp_output_layer_id], dim=-1)
                            else:
                                logits_softmax[tmp_output_layer_id] = logits[tmp_output_layer_id]

                    if ProblemTypes[self.problem.problem_type] == ProblemTypes.sequence_tagging:
                        logits = list(logits.values())[0]
                        if isinstance(get_layer_class(self.model, tmp_output_layer_id), CRF):
                            forward_score, scores, masks, tag_seq, transitions, layer_conf = logits
                            prediction_indices = tag_seq.cpu().numpy()
                        else:
                            logits_softmax = list(logits_softmax.values())[0]
                            # Transform output shapes for metric evaluation
                            # for seq_tag_f1 metric
                            prediction_indices = logits_softmax.data.max(2)[1].cpu().numpy()  # [batch_size, seq_len]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



LearningMachine.py [807:836]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            logits = self.model(inputs_desc, length_desc, *param_list)

            logits_softmax = {}
            if isinstance(self.model, nn.DataParallel):
                for tmp_output_layer_id in self.model.module.output_layer_id:
                    if isinstance(self.model.module.layers[tmp_output_layer_id], Linear) and \
                            (not self.model.module.layers[tmp_output_layer_id].layer_conf.last_hidden_softmax):
                        logits_softmax[tmp_output_layer_id] = nn.functional.softmax(
                            logits[tmp_output_layer_id], dim=-1)
                    else:
                        logits_softmax[tmp_output_layer_id] = logits[tmp_output_layer_id]
            else:
                for tmp_output_layer_id in self.model.output_layer_id:
                    if isinstance(self.model.layers[tmp_output_layer_id], Linear) and \
                            (not self.model.layers[tmp_output_layer_id].layer_conf.last_hidden_softmax):
                        logits_softmax[tmp_output_layer_id] = nn.functional.softmax(
                            logits[tmp_output_layer_id], dim=-1)
                    else:
                        logits_softmax[tmp_output_layer_id] = logits[tmp_output_layer_id]

            if ProblemTypes[self.problem.problem_type] == ProblemTypes.sequence_tagging:
                logits = list(logits.values())[0]
                if isinstance(get_layer_class(self.model, tmp_output_layer_id), CRF):
                    forward_score, scores, masks, tag_seq, transitions, layer_conf = logits
                    prediction_indices = tag_seq.cpu().numpy()
                else:
                    logits_softmax = list(logits_softmax.values())[0]
                    # Transform output shapes for metric evaluation
                    # for seq_tag_f1 metric
                    prediction_indices = logits_softmax.data.max(2)[1].cpu().numpy()  # [batch_size, seq_len]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



