Examples/tensorflow/compression/spatial_svd.py
def evaluate(self, sess: tf.Session, iterations: int = None, use_cuda: bool = False) -> float:
        """
        Evaluate the specified session using the specified number of samples from the validation set.
        AIMET's compress_model() expects the function with this signature to its eval_callback
        parameter.

        :param sess: The sess graph to be evaluated.
        :param iterations: The number of batches of the dataset.
        :param use_cuda: If True then use a GPU for inference. (Note: This variable is not used in this function)
        :return: The accuracy for the sample with the maximum accuracy.
        """

        # your code goes here instead of the example from below

        evaluator = ImageNetEvaluator(self._config.tfrecord_dir, training_inputs=['keras_learning_phase:0'],
                                      data_inputs=['input_1:0'], validation_inputs=['labels:0'],
                                      image_size=image_net_config.dataset['image_size'],
                                      batch_size=image_net_config.evaluation['batch_size'],
                                      format_bgr=True)

        return evaluator.evaluate(sess, iterations)

        Evaluate the specified session using the specified number of samples from the validation set.
        AIMET's compress_model() expects the function with this signature to its eval_callback
        parameter.

        :param sess: The sess graph to be evaluated.
        :param iterations: The number of batches of the dataset.
        :param use_cuda: If True then use a GPU for inference. (Note: This variable is not used in this function)
        :return: The accuracy for the sample with the maximum accuracy.
        
Evaluate the specified session using the specified number of samples from the validation set.
AIMET's compress_model() expects the function with this signature to its eval_callback
parameter.
Evaluate the specified session using the specified number of samples from the validation set . AIMET ' s compress_model () expects the function with this signature to its eval_callback parameter .
def evaluate(self, sess: tf.Session, iterations: int = None, use_cuda: bool = False) -> float:
        evaluator = ImageNetEvaluator(self._config.tfrecord_dir, training_inputs=['keras_learning_phase:0'],
                                      data_inputs=['input_1:0'], validation_inputs=['labels:0'],
                                      image_size=image_net_config.dataset['image_size'],
                                      batch_size=image_net_config.evaluation['batch_size'],
                                      format_bgr=True)
        return evaluator.evaluate(sess, iterations)
def evaluate ( self , sess : tf . Session , iterations : int = None , use_cuda : bool = False ) -> float : evaluator = ImageNetEvaluator ( self . _config . tfrecord_dir , training_inputs = [ 'keras_learning_phase:0' ] , data_inputs = [ 'input_1:0' ] , validation_inputs = [ 'labels:0' ] , image_size = image_net_config . dataset [ 'image_size' ] , batch_size = image_net_config . evaluation [ 'batch_size' ] , format_bgr = True ) return evaluator . evaluate ( sess , iterations )
Evaluate the specified session using the specified number of samples from the validation set.
Evaluate the specified session using the specified number of samples from the validation set .
"""
        Evaluate the specified session using the specified number of samples from the validation set.
        AIMET's compress_model() expects the function with this signature to its eval_callback
        parameter.

        :param sess: The sess graph to be evaluated.
        :param iterations: The number of batches of the dataset.
        :param use_cuda: If True then use a GPU for inference. (Note: This variable is not used in this function)
        :return: The accuracy for the sample with the maximum accuracy.
        """ # your code goes here instead of the example from below
The accuracy for the sample with the maximum accuracy.
The accuracy for the sample with the maximum accuracy .
self
sess
tf.Session
The sess graph to be evaluated.
The sess graph to be evaluated .
iterations
int
The number of batches of the dataset.
The number of batches of the dataset .
use_cuda
bool
If True then use a GPU for inference. (Note: This variable is not used in this function)
If True then use a GPU for inference . ( Note : This variable is not used in this function )