rfho/models.py
def initialize(self, session=None):
        """
        Initialize the model. If `deterministic_initialization` is set to true, 
        saves the initial weight in numpy which will be used for subsequent initialization.
        This is because random seed management in tensorflow is rather obscure... and I could not
        find a way to set the same seed across different initialization without exiting the session.
        
        :param session: 
        :return: 
        """
        ss = session or tf.get_default_session()
        assert ss, 'No default session'
        if not self._var_initializer_op:
            self._var_initializer_op = tf.variables_initializer(self.var_list)
        ss.run(self._var_initializer_op)
        if self.deterministic_initialization:
            if self._var_init_placeholder is None:
                self._var_init_placeholder = tf.placeholder(tf.float32)
                self._assign_int = [v.assign(self._var_init_placeholder) for v in self.var_list]

            if not self._var_list_initial_values:
                self._var_list_initial_values = ss.run(self.var_list)

            else:
                [ss.run(v_op, feed_dict={self._var_init_placeholder: val})
                 for v_op, val in zip(self._assign_int, self._var_list_initial_values)]

        Initialize the model. If `deterministic_initialization` is set to true, 
        saves the initial weight in numpy which will be used for subsequent initialization.
        This is because random seed management in tensorflow is rather obscure... and I could not
        find a way to set the same seed across different initialization without exiting the session.
        
        :param session: 
        :return: 
        
Initialize the model. If `deterministic_initialization` is set to true,
saves the initial weight in numpy which will be used for subsequent initialization.
This is because random seed management in tensorflow is rather obscure... and I could not
find a way to set the same seed across different initialization without exiting the session.
Initialize the model . If ` deterministic_initialization ` is set to true saves the initial weight in numpy which will be used for subsequent initialization . This is because random seed management in tensorflow is rather obscure ... and I could not find a way to set the same seed across different initialization without exiting the session .
def initialize(self, session=None):
        ss = session or tf.get_default_session()
        assert ss, 'No default session'
        if not self._var_initializer_op:
            self._var_initializer_op = tf.variables_initializer(self.var_list)
        ss.run(self._var_initializer_op)
        if self.deterministic_initialization:
            if self._var_init_placeholder is None:
                self._var_init_placeholder = tf.placeholder(tf.float32)
                self._assign_int = [v.assign(self._var_init_placeholder) for v in self.var_list]
            if not self._var_list_initial_values:
                self._var_list_initial_values = ss.run(self.var_list)
            else:
                [ss.run(v_op, feed_dict={self._var_init_placeholder: val})
                 for v_op, val in zip(self._assign_int, self._var_list_initial_values)]
def initialize ( self , session = None ) : ss = session or tf . get_default_session ( ) assert ss , 'No default session' if not self . _var_initializer_op : self . _var_initializer_op = tf . variables_initializer ( self . var_list ) ss . run ( self . _var_initializer_op ) if self . deterministic_initialization : if self . _var_init_placeholder is None : self . _var_init_placeholder = tf . placeholder ( tf . float32 ) self . _assign_int = [ v . assign ( self . _var_init_placeholder ) for v in self . var_list ] if not self . _var_list_initial_values : self . _var_list_initial_values = ss . run ( self . var_list ) else : [ ss . run ( v_op , feed_dict = { self . _var_init_placeholder : val } ) for v_op , val in zip ( self . _assign_int , self . _var_list_initial_values ) ]
Initialize the model.
Initialize the model .
"""
        Initialize the model. If `deterministic_initialization` is set to true, 
        saves the initial weight in numpy which will be used for subsequent initialization.
        This is because random seed management in tensorflow is rather obscure... and I could not
        find a way to set the same seed across different initialization without exiting the session.
        
        :param session: 
        :return: 
        """
None
self
session
None