def get_coreml_model(self, mode = 'classifier'):
        """
        Parameters
        ----------
        mode: str ('classifier', 'regressor' or None)
            Mode of the converted coreml model.
            When mode = 'classifier', a NeuralNetworkClassifier spec will be constructed.
            When mode = 'regressor', a NeuralNetworkRegressor spec will be constructed.

        Returns
        -------
        model: MLModel
            Return the underlying model.
        """
        import mxnet as _mx
        from ._mxnet import _mxnet_utils
        from ._mxnet._mxnet_to_coreml import _mxnet_converter

        (sym, arg_params, aux_params) = self.ptModel.mxmodel
        fe_mxmodel = self.ptModel.mxmodel

        if self.ptModel.is_feature_layer_final:
            feature_layer_size = self.ptModel.feature_layer_size
            num_dummy_classes = 10
            feature_layer_sym = sym.get_children()[0]
            fc_symbol = _mx.symbol.FullyConnected(feature_layer_sym, num_hidden=num_dummy_classes)
            prob = _mx.symbol.SoftmaxOutput(fc_symbol, name = sym.name, attr=sym.attr_dict()[sym.name])
            arg_params['%s_weight' % fc_symbol.name] = _mx.ndarray.zeros((num_dummy_classes, feature_layer_size))
            arg_params['%s_bias' % fc_symbol.name] = _mx.ndarray.zeros((num_dummy_classes))
            fe_mxmodel = (prob, arg_params, aux_params)

        model = MXFeatureExtractor._get_mx_module(fe_mxmodel,
                self.data_layer, self.ptModel.output_layer, _mxnet_utils.get_mxnet_context(max_devices=1),
                self.image_shape, label_layer = self.ptModel.label_layer)

        preprocessor_args = {'image_input_names': [self.data_layer]}
        return _mxnet_converter.convert(model, mode = 'classifier',
                input_shape=[(self.data_layer, (1, ) + self.image_shape)],
                class_labels = list(map(str, range(self.ptModel.num_classes))),
                preprocessor_args = preprocessor_args, verbose = False)