rfho/hyper_gradients.py
def initialize(self, session=None, complete_reinitialize=False):
        """
        Initialize all tensorflow variables. This method has two behaviours:

        - first time it is called (after entering a Session run block) or when flag `complete_reinitialize` is `True`
            initializes all the relevant variables
        - subsequent times, reinitialize only model variables (next hyper-iteration).
        
        :param: complete_reinitialize: (default `False`) if True reinitialize hyper-step counts and hyperparameter
                                        optimizers regardless of
        :param: session: optional tensorflow session (if None default session is used) 

        :return: True if this is the first initialization
        """
        ss = tf.get_default_session()
        assert ss, 'No default session.'

        never_initialized = bool(self._report_hyper_it_init.eval())

        if complete_reinitialize or never_initialized:  # never initialized or subsequent run of
            # Session run block (for instance in a Ipython book)
            tf.variables_initializer(self.hyper_gradients.hyper_list).run()
            if self.hyper_optimizers:
                [opt.support_variables_initializer().run() for opt in self.hyper_optimizers]
            tf.variables_initializer([self.hyper_iteration_step.var, self.hyper_batch_step.var]).run()
        else:
            self.hyper_iteration_step.increase.eval()

        self.hyper_gradients.initialize(session=session)

        return never_initialized

        Initialize all tensorflow variables. This method has two behaviours:

        - first time it is called (after entering a Session run block) or when flag `complete_reinitialize` is `True`
            initializes all the relevant variables
        - subsequent times, reinitialize only model variables (next hyper-iteration).
        
        :param: complete_reinitialize: (default `False`) if True reinitialize hyper-step counts and hyperparameter
                                        optimizers regardless of
        :param: session: optional tensorflow session (if None default session is used) 

        :return: True if this is the first initialization
        
Initialize all tensorflow variables. This method has two behaviours:
first time it is called (after entering a Session run block) or when flag `complete_reinitialize` is `True`
initializes all the relevant variables
subsequent times, reinitialize only model variables (next hyper-iteration).



:return: True if this is the first initialization
Initialize all tensorflow variables . This method has two behaviours : first time it is called ( after entering a Session run block ) or when flag ` complete_reinitialize ` is ` True ` initializes all the relevant variables subsequent times reinitialize only model variables ( next hyper - iteration ) . : return : True if this is the first initialization
def initialize(self, session=None, complete_reinitialize=False):
        ss = tf.get_default_session()
        assert ss, 'No default session.'
        never_initialized = bool(self._report_hyper_it_init.eval())
        if complete_reinitialize or never_initialized:  
            tf.variables_initializer(self.hyper_gradients.hyper_list).run()
            if self.hyper_optimizers:
                [opt.support_variables_initializer().run() for opt in self.hyper_optimizers]
            tf.variables_initializer([self.hyper_iteration_step.var, self.hyper_batch_step.var]).run()
        else:
            self.hyper_iteration_step.increase.eval()
        self.hyper_gradients.initialize(session=session)
        return never_initialized
def initialize ( self , session = None , complete_reinitialize = False ) : ss = tf . get_default_session ( ) assert ss , 'No default session.' never_initialized = bool ( self . _report_hyper_it_init . eval ( ) ) if complete_reinitialize or never_initialized : tf . variables_initializer ( self . hyper_gradients . hyper_list ) . run ( ) if self . hyper_optimizers : [ opt . support_variables_initializer ( ) . run ( ) for opt in self . hyper_optimizers ] tf . variables_initializer ( [ self . hyper_iteration_step . var , self . hyper_batch_step . var ] ) . run ( ) else : self . hyper_iteration_step . increase . eval ( ) self . hyper_gradients . initialize ( session = session ) return never_initialized
Initialize all tensorflow variables.
Initialize all tensorflow variables .
"""
        Initialize all tensorflow variables. This method has two behaviours:

        - first time it is called (after entering a Session run block) or when flag `complete_reinitialize` is `True`
            initializes all the relevant variables
        - subsequent times, reinitialize only model variables (next hyper-iteration).
        
        :param: complete_reinitialize: (default `False`) if True reinitialize hyper-step counts and hyperparameter
                                        optimizers regardless of
        :param: session: optional tensorflow session (if None default session is used) 

        :return: True if this is the first initialization
        """ # never initialized or subsequent run of # Session run block (for instance in a Ipython book)
self
session
complete_reinitialize