main.py
def grad_wrt_val_loss_batch(self, batch=None, feed_extra=None, **kwargs):
        """ get grad of loss on validation set w.r.t the params """
        batch = batch or FLAGS.batch
        images, labels = self.tmp.cache['valid']
        indexes = np.random.randint(
            low=0, high=images.shape[0], size=batch * self.params['uratio'])
        grad = self.session.run(
            self.classify_v.grad_val_loss_op,
            feed_dict={
                self.classify_v.v: images[indexes],
                self.classify_v.l: labels[indexes],
                **(feed_extra or {})
            })
        grad_vec = np.concatenate([g.flatten() for g in grad])
        # print('Total number of parameters: %s' % len(grad_vec))
        return grad_vec
 get grad of loss on validation set w.r.t the params 
get grad of loss on validation set w.r.t the params
get grad of loss on validation set w . r . t the params
def grad_wrt_val_loss_batch(self, batch=None, feed_extra=None, **kwargs):
        batch = batch or FLAGS.batch
        images, labels = self.tmp.cache['valid']
        indexes = np.random.randint(
            low=0, high=images.shape[0], size=batch * self.params['uratio'])
        grad = self.session.run(
            self.classify_v.grad_val_loss_op,
            feed_dict={
                self.classify_v.v: images[indexes],
                self.classify_v.l: labels[indexes],
                **(feed_extra or {})
            })
        grad_vec = np.concatenate([g.flatten() for g in grad])
        return grad_vec
def grad_wrt_val_loss_batch ( self , batch = None , feed_extra = None , ** kwargs ) : batch = batch or FLAGS . batch images , labels = self . tmp . cache [ 'valid' ] indexes = np . random . randint ( low = 0 , high = images . shape [ 0 ] , size = batch * self . params [ 'uratio' ] ) grad = self . session . run ( self . classify_v . grad_val_loss_op , feed_dict = { self . classify_v . v : images [ indexes ] , self . classify_v . l : labels [ indexes ] , ** ( feed_extra or { } ) } ) grad_vec = np . concatenate ( [ g . flatten ( ) for g in grad ] ) return grad_vec
get grad of loss on validation set w.r.t the params
get grad of loss on validation set w . r . t the params
""" get grad of loss on validation set w.r.t the params """ # print('Total number of parameters: %s' % len(grad_vec))
self
batch
feed_extra