validator.py
def combine_objectives(self, obj_results, alphas=None,
                           max_normalization=None):
        """A method combines the values passed to it.

        Combine the results of objectives/losses passed using alphas and
        max normalization, if set. Used after validation by the Trainer.
        Example:
            results = validator.evaluate()
            validation_loss = validator.combine_objectives(results[1],
                                                           alphas,
                                                           max_normalization)

        Args:
            obj_results: A list of floats.
            alphas: A list of alpha values to be multiplied with the
                objectives, default = None
            max_normalization: A list of values to divide the objectives with,
                default = None

        Returns:
            A float containing the combined value of the objectives.
        Raises:
            TypeError: If obj_results is not set. Also raises this error if any
                of the arguments are of the incorrect type.
            ValueError: If obj_results, alphas and max_normalization do not
            have the same dimensions.
        """
        # Missing argument error
        if obj_results is None:
            raise TypeError('Argument: obj_results must be set.')
        # Wrong type argument errors
        if not isinstance(obj_results, list):
            raise TypeError('Argument: obj_results must be a list.')
        elif alphas and not isinstance(alphas, list):
            raise TypeError('Argument: alphas must be a list.')
        elif max_normalization and not isinstance(max_normalization, list):
            raise TypeError('Argument: max_normalization must be a list.')

        if not all(isinstance(i, (np.floating, float, np.integer, int))
                   for i in obj_results):
            raise TypeError('All elements of argument: obj_results must be'
                            + ' of type int or float.')
        elif alphas and not all(isinstance(i, (np.floating, float,
                                               np.integer, int))
                                for i in alphas):
            raise TypeError('All elements of argument: alphas must be'
                            + ' of type int or float.')
        elif max_normalization and not all(isinstance(i, (np.floating, float,
                                                          np.integer, int))
                                           for i in max_normalization):
            raise TypeError('All elements of argument: max_normalization must'
                            + ' be of type int or float.')
        # Incorrect dimensions
        if alphas and len(alphas) != len(obj_results):
            raise ValueError('The length of alphas must be equal to'
                             + ' that of obj_results')
        if max_normalization and len(max_normalization) != len(obj_results):
            raise ValueError('The length of max_normalization must be equal to'
                             + ' that of obj_results')

        if alphas is None:
            alphas = [1]*len(obj_results)
        if max_normalization is None:
            max_normalization = [1]*len(obj_results)
        return sum(1/max_normalization[i]*alphas[i]*obj_results[i]
                   for i in range(len(alphas)))
A method combines the values passed to it.

        Combine the results of objectives/losses passed using alphas and
        max normalization, if set. Used after validation by the Trainer.
        Example:
            results = validator.evaluate()
            validation_loss = validator.combine_objectives(results[1],
                                                           alphas,
                                                           max_normalization)

        Args:
            obj_results: A list of floats.
            alphas: A list of alpha values to be multiplied with the
                objectives, default = None
            max_normalization: A list of values to divide the objectives with,
                default = None

        Returns:
            A float containing the combined value of the objectives.
        Raises:
            TypeError: If obj_results is not set. Also raises this error if any
                of the arguments are of the incorrect type.
            ValueError: If obj_results, alphas and max_normalization do not
            have the same dimensions.
        
A method combines the values passed to it.
Combine the results of objectives/losses passed using alphas and
max normalization, if set. Used after validation by the Trainer.

A list of floats.
alphas: A list of alpha values to be multiplied with the
objectives, default = None
max_normalization: A list of values to divide the objectives with,
default = None

A float containing the combined value of the objectives.
Raises:
TypeError: If obj_results is not set. Also raises this error if any
of the arguments are of the incorrect type.
ValueError: If obj_results, alphas and max_normalization do not
have the same dimensions.
A method combines the values passed to it . Combine the results of objectives / losses passed using alphas and max normalization if set . Used after validation by the Trainer . A list of floats . alphas : A list of alpha values to be multiplied with the objectives default = None max_normalization : A list of values to divide the objectives with default = None A float containing the combined value of the objectives . Raises : TypeError : If obj_results is not set . Also raises this error if any of the arguments are of the incorrect type . ValueError : If obj_results alphas and max_normalization do not have the same dimensions .
def combine_objectives(self, obj_results, alphas=None,
                           max_normalization=None):
        if obj_results is None:
            raise TypeError('Argument: obj_results must be set.')
        if not isinstance(obj_results, list):
            raise TypeError('Argument: obj_results must be a list.')
        elif alphas and not isinstance(alphas, list):
            raise TypeError('Argument: alphas must be a list.')
        elif max_normalization and not isinstance(max_normalization, list):
            raise TypeError('Argument: max_normalization must be a list.')
        if not all(isinstance(i, (np.floating, float, np.integer, int))
                   for i in obj_results):
            raise TypeError('All elements of argument: obj_results must be'
                            + ' of type int or float.')
        elif alphas and not all(isinstance(i, (np.floating, float,
                                               np.integer, int))
                                for i in alphas):
            raise TypeError('All elements of argument: alphas must be'
                            + ' of type int or float.')
        elif max_normalization and not all(isinstance(i, (np.floating, float,
                                                          np.integer, int))
                                           for i in max_normalization):
            raise TypeError('All elements of argument: max_normalization must'
                            + ' be of type int or float.')
        if alphas and len(alphas) != len(obj_results):
            raise ValueError('The length of alphas must be equal to'
                             + ' that of obj_results')
        if max_normalization and len(max_normalization) != len(obj_results):
            raise ValueError('The length of max_normalization must be equal to'
                             + ' that of obj_results')
        if alphas is None:
            alphas = [1]*len(obj_results)
        if max_normalization is None:
            max_normalization = [1]*len(obj_results)
        return sum(1/max_normalization[i]*alphas[i]*obj_results[i]
                   for i in range(len(alphas)))
def combine_objectives ( self , obj_results , alphas = None , max_normalization = None ) : if obj_results is None : raise TypeError ( 'Argument: obj_results must be set.' ) if not isinstance ( obj_results , list ) : raise TypeError ( 'Argument: obj_results must be a list.' ) elif alphas and not isinstance ( alphas , list ) : raise TypeError ( 'Argument: alphas must be a list.' ) elif max_normalization and not isinstance ( max_normalization , list ) : raise TypeError ( 'Argument: max_normalization must be a list.' ) if not all ( isinstance ( i , ( np . floating , float , np . integer , int ) ) for i in obj_results ) : raise TypeError ( 'All elements of argument: obj_results must be' + ' of type int or float.' ) elif alphas and not all ( isinstance ( i , ( np . floating , float , np . integer , int ) ) for i in alphas ) : raise TypeError ( 'All elements of argument: alphas must be' + ' of type int or float.' ) elif max_normalization and not all ( isinstance ( i , ( np . floating , float , np . integer , int ) ) for i in max_normalization ) : raise TypeError ( 'All elements of argument: max_normalization must' + ' be of type int or float.' ) if alphas and len ( alphas ) != len ( obj_results ) : raise ValueError ( 'The length of alphas must be equal to' + ' that of obj_results' ) if max_normalization and len ( max_normalization ) != len ( obj_results ) : raise ValueError ( 'The length of max_normalization must be equal to' + ' that of obj_results' ) if alphas is None : alphas = [ 1 ] * len ( obj_results ) if max_normalization is None : max_normalization = [ 1 ] * len ( obj_results ) return sum ( 1 / max_normalization [ i ] * alphas [ i ] * obj_results [ i ] for i in range ( len ( alphas ) ) )
A method combines the values passed to it.
A method combines the values passed to it .
"""A method combines the values passed to it.

        Combine the results of objectives/losses passed using alphas and
        max normalization, if set. Used after validation by the Trainer.
        Example:
            results = validator.evaluate()
            validation_loss = validator.combine_objectives(results[1],
                                                           alphas,
                                                           max_normalization)

        Args:
            obj_results: A list of floats.
            alphas: A list of alpha values to be multiplied with the
                objectives, default = None
            max_normalization: A list of values to divide the objectives with,
                default = None

        Returns:
            A float containing the combined value of the objectives.
        Raises:
            TypeError: If obj_results is not set. Also raises this error if any
                of the arguments are of the incorrect type.
            ValueError: If obj_results, alphas and max_normalization do not
            have the same dimensions.
        """ # Missing argument error # Wrong type argument errors # Incorrect dimensions
self
obj_results
alphas
max_normalization