Exemple #1
0
 def get_monitoring_channels(self, model, data, **kwargs):
     d = Cost.get_monitoring_channels(self, model, data)
     if self.dropout:
         self.dropout = False
         d['nodrop_obj'] = self.expr(model, data, **kwargs)
         self.dropout = True
     return d
Exemple #2
0
 def get_gradients(self, model, data, unsup_aux_var=None, **kwargs):
     self.get_data_specs(model)[0].validate(data)
     assert unsup_aux_var is unsup_counter
     called[1] = True
     gradients, updates = Cost.get_gradients(self, model, data, unsup_aux_var=unsup_aux_var)
     updates[grad_counter] = grad_counter + 1
     return gradients, updates
Exemple #3
0
 def get_monitoring_channels(self, model, data, **kwargs):
     d = Cost.get_monitoring_channels(self, model, data)
     if self.dropout:
         self.dropout = False
         d['nodrop_obj'] = self.expr(model, data, **kwargs)
         self.dropout = True
     return d
Exemple #4
0
 def get_gradients(self, model, data, unsup_aux_var=None, **kwargs):
     self.get_data_specs(model)[0].validate(data)
     assert unsup_aux_var is unsup_counter
     called[1] = True
     gradients, updates = Cost.get_gradients(
         self, model, data, unsup_aux_var=unsup_aux_var)
     updates[grad_counter] = grad_counter + 1
     return gradients, updates
Exemple #5
0
 def get_gradients(self,
                   model,
                   X,
                   Y=None,
                   unsup_aux_var=None,
                   **kwargs):
     assert unsup_aux_var is unsup_counter
     called[1] = True
     gradients, updates = Cost.get_gradients(
         self, model, X, Y, unsup_aux_var=unsup_aux_var)
     updates[grad_counter] = grad_counter + 1
     return gradients, updates
Exemple #6
0
 def get_gradients(self, model, X, Y=None, unsup_aux_var=None, **kwargs):
     assert unsup_aux_var is unsup_counter
     called[1] = True
     gradients, updates = Cost.get_gradients(self, model, X, Y, unsup_aux_var=unsup_aux_var)
     updates[grad_counter] = grad_counter + 1
     return gradients, updates