nn/basicNetwork.py
def make_optimizer(self, train_var_filter):
        """
        Make optimizer fot the network, Adam is used
        :param train_var_filter: if not None, only optimize variables in train_var_filter
        :return:
        """
        with tf.control_dependencies(self.update_ops):
            if train_var_filter is None:
                self.optimizer = tf.train.AdamOptimizer(self.lr_op).minimize(self.loss, global_step=self.global_step)
            else:
                print('Train parameters in scope:')
                for layer in train_var_filter:
                    print(layer)
                train_vars = tf.trainable_variables()
                var_list = []
                for var in train_vars:
                    if var.name.split('/')[0] in train_var_filter:
                        var_list.append(var)
                self.optimizer = tf.train.AdamOptimizer(self.lr_op).minimize(self.loss, global_step=self.global_step,
                                                                             var_list=var_list)

        Make optimizer fot the network, Adam is used
        :param train_var_filter: if not None, only optimize variables in train_var_filter
        :return:
        
Make optimizer fot the network, Adam is used
Make optimizer fot the network Adam is used
def make_optimizer(self, train_var_filter):
        with tf.control_dependencies(self.update_ops):
            if train_var_filter is None:
                self.optimizer = tf.train.AdamOptimizer(self.lr_op).minimize(self.loss, global_step=self.global_step)
            else:
                print('Train parameters in scope:')
                for layer in train_var_filter:
                    print(layer)
                train_vars = tf.trainable_variables()
                var_list = []
                for var in train_vars:
                    if var.name.split('/')[0] in train_var_filter:
                        var_list.append(var)
                self.optimizer = tf.train.AdamOptimizer(self.lr_op).minimize(self.loss, global_step=self.global_step,
                                                                             var_list=var_list)
def make_optimizer ( self , train_var_filter ) : with tf . control_dependencies ( self . update_ops ) : if train_var_filter is None : self . optimizer = tf . train . AdamOptimizer ( self . lr_op ) . minimize ( self . loss , global_step = self . global_step ) else : print ( 'Train parameters in scope:' ) for layer in train_var_filter : print ( layer ) train_vars = tf . trainable_variables ( ) var_list = [ ] for var in train_vars : if var . name . split ( '/' ) [ 0 ] in train_var_filter : var_list . append ( var ) self . optimizer = tf . train . AdamOptimizer ( self . lr_op ) . minimize ( self . loss , global_step = self . global_step , var_list = var_list )
Make optimizer fot the network, Adam is used
Make optimizer fot the network Adam is used
"""
        Make optimizer fot the network, Adam is used
        :param train_var_filter: if not None, only optimize variables in train_var_filter
        :return:
        """
None
self
train_var_filter
if not None, only optimize variables in train_var_filter
if not None only optimize variables in train_var_filter