(self, inputs, targets)
Compute the cost function over a list of inputs and targets.

        Arguments:
            inputs (list(Tensor)): list of Tensors containing input values to be compared to
                                   targets
            targets (Tensor, list(Tensor)): either a list of Tensors containing target values, or
                                            a single target Tensor that will be mapped to each
                                            input

        Returns:
            Tensor containing cost
Compute the cost function over a list of inputs and targets.
Compute the cost function over a list of inputs and targets .
def get_cost(self, inputs, targets):
        """
        Compute the cost function over a list of inputs and targets.

        Arguments:
            inputs (list(Tensor)): list of Tensors containing input values to be compared to
                                   targets
            targets (Tensor, list(Tensor)): either a list of Tensors containing target values, or
                                            a single target Tensor that will be mapped to each
                                            input

        Returns:
            Tensor containing cost
        """
        if not isinstance(inputs, list):
            return self.costs[0].get_cost(inputs, targets)
        else:
            if type(targets) not in (tuple, list):
                targets = [targets] * len(self.costs)

            costs = []
            for w, c, i, t in zip(self.weights, self.costs, inputs, targets):
                # TODO: use sentinal class instead of None

                # it is important that we don't even call get_cost on costs
                # which aren't applicable because there are hooks and state
                # that get set that we don't want to include.
                if t is not None:
                    costs.append(w * c.get_cost(i, t))

            return reduce(add, costs)
def get_cost ( self , inputs , targets ) : if not isinstance ( inputs , list ) : return self . costs [ 0 ] . get_cost ( inputs , targets ) else : if type ( targets ) not in ( tuple , list ) : targets = [ targets ] * len ( self . costs ) costs = [ ] for w , c , i , t in zip ( self . weights , self . costs , inputs , targets ) : # TODO: use sentinal class instead of None # it is important that we don't even call get_cost on costs # which aren't applicable because there are hooks and state # that get set that we don't want to include. if t is not None : costs . append ( w * c . get_cost ( i , t ) ) return reduce ( add , costs )