def __init__(self, ignore_label, axis=-1, name='perplexity',
                 output_names=None, label_names=None):
        super(Perplexity, self).__init__(
            name, ignore_label=ignore_label,
            output_names=output_names, label_names=label_names)
        self.ignore_label = ignore_label
        self.axis = axis