rfho/hyper_gradients.py
def forward(self, T, train_feed_dict_supplier=None, summary_utils=None):
        """
        Performs (forward) optimization of the parameters.

        :param T: Total number of iterations
        :param train_feed_dict_supplier: (optional) A callable with signature `t -> feed_dict`
                                            or `() -> feed_dict` to pass to
                                            `tf.Session.run` feed_dict argument
        :param summary_utils: (optional) object that implements a method method `run(tf.Session, step)`
                                that is executed at every iteration (see for instance utils.PrintUtils
        :return: None
        """
        if not train_feed_dict_supplier:
            train_feed_dict_supplier = lambda: None

        # var_init = self.w.var_list(VlMode.BASE) if isinstance(self.w, MergedVariable) else [self.w]
        # tf.variables_initializer(var_init + [self.global_step.var]).run()

        ss = tf.get_default_session()
        self.w_hist.clear()

        for t in range(T):
            self.w_hist.append(self.w_t.eval())
            ss.run([self._fw_ops], feed_dict=cmo(train_feed_dict_supplier, self.global_step.eval()))
            self.global_step.increase.eval()
            if summary_utils:
                summary_utils.run(ss, t)

        Performs (forward) optimization of the parameters.

        :param T: Total number of iterations
        :param train_feed_dict_supplier: (optional) A callable with signature `t -> feed_dict`
                                            or `() -> feed_dict` to pass to
                                            `tf.Session.run` feed_dict argument
        :param summary_utils: (optional) object that implements a method method `run(tf.Session, step)`
                                that is executed at every iteration (see for instance utils.PrintUtils
        :return: None
        
Performs (forward) optimization of the parameters.
Performs ( forward ) optimization of the parameters .
def forward(self, T, train_feed_dict_supplier=None, summary_utils=None):
        if not train_feed_dict_supplier:
            train_feed_dict_supplier = lambda: None
        ss = tf.get_default_session()
        self.w_hist.clear()
        for t in range(T):
            self.w_hist.append(self.w_t.eval())
            ss.run([self._fw_ops], feed_dict=cmo(train_feed_dict_supplier, self.global_step.eval()))
            self.global_step.increase.eval()
            if summary_utils:
                summary_utils.run(ss, t)
def forward ( self , T , train_feed_dict_supplier = None , summary_utils = None ) : if not train_feed_dict_supplier : train_feed_dict_supplier = lambda : None ss = tf . get_default_session ( ) self . w_hist . clear ( ) for t in range ( T ) : self . w_hist . append ( self . w_t . eval ( ) ) ss . run ( [ self . _fw_ops ] , feed_dict = cmo ( train_feed_dict_supplier , self . global_step . eval ( ) ) ) self . global_step . increase . eval ( ) if summary_utils : summary_utils . run ( ss , t )
Performs (forward) optimization of the parameters.
Performs ( forward ) optimization of the parameters .
"""
        Performs (forward) optimization of the parameters.

        :param T: Total number of iterations
        :param train_feed_dict_supplier: (optional) A callable with signature `t -> feed_dict`
                                            or `() -> feed_dict` to pass to
                                            `tf.Session.run` feed_dict argument
        :param summary_utils: (optional) object that implements a method method `run(tf.Session, step)`
                                that is executed at every iteration (see for instance utils.PrintUtils
        :return: None
        """ # var_init = self.w.var_list(VlMode.BASE) if isinstance(self.w, MergedVariable) else [self.w] # tf.variables_initializer(var_init + [self.global_step.var]).run()
None
self
T
Total number of iterations
Total number of iterations
train_feed_dict_supplier
(optional) A callable with signature `t -> feed_dict`
or `() -> feed_dict` to pass to
`tf.Session.run` feed_dict argument
( optional ) A callable with signature ` t - > feed_dict ` or ` () - > feed_dict ` to pass to ` tf . Session . run ` feed_dict argument
summary_utils
(optional) object that implements a method method `run(tf.Session, step)`
that is executed at every iteration (see for instance utils.PrintUtils
( optional ) object that implements a method method ` run ( tf . Session step ) ` that is executed at every iteration ( see for instance utils . PrintUtils