def setup(self, model, dataset, algorithm):
        """
        Add WMAPE Numerator channels for monitoring dataset(s) to
        model.monitor.

        Parameters
        ----------
        model : object
            The model being trained.
        dataset : object
            Training dataset.
        algorithm : object
            Training algorithm.
        """
        m_space, m_source = model.get_monitoring_data_specs()
        state, target = m_space.make_theano_batch()

        y = target[:, 0]
        y_hat = model.fprop(state)[:, 0]

        wmape_numerator = abs(y * y_hat).sum()
        wmape_numerator = T.cast(wmape_numerator, config.floatX)
        for dataset_name, dataset in algorithm.monitoring_dataset.items():
            if dataset_name:
                channel_name = '{0}_{1}'.format(dataset_name,
                                                self.channel_name_suffix)
            else:
                channel_name = self.channel_name_suffix
            model.monitor.add_channel(name=channel_name,
                                      ipt=(state, target),
                                      val=wmape_numerator,
                                      data_specs=(m_space, m_source),
                                      dataset=dataset)
dataset/ETHPy150Open lisa-lab/pylearn2/pylearn2/train_extensions/wmape_channel.py/WMapeNumeratorChannel.setup/operator `-` -> `*`