brainstorm/training/trainer.py
def _call_hook(self, hook, net):
        """Call a hook and check if raises a stopping signal."""
        try:
            return hook(epoch_nr=self.current_epoch_nr,
                        update_nr=self.current_update_nr,
                        net=net,
                        stepper=self.stepper, logs=self.logs), False
        except StopIteration as err:
            return getattr(err, 'value', None), True
        except Exception as e:
            print('An error occurred while calling the "{}" hook:'
                  .format(hook.__name__), file=sys.stderr)
            print(traceback.format_exc())
            raise e
Call a hook and check if raises a stopping signal.
Call a hook and check if raises a stopping signal.
Call a hook and check if raises a stopping signal .
def _call_hook(self, hook, net):
        try:
            return hook(epoch_nr=self.current_epoch_nr,
                        update_nr=self.current_update_nr,
                        net=net,
                        stepper=self.stepper, logs=self.logs), False
        except StopIteration as err:
            return getattr(err, 'value', None), True
        except Exception as e:
            print('An error occurred while calling the "{}" hook:'
                  .format(hook.__name__), file=sys.stderr)
            print(traceback.format_exc())
            raise e
def _call_hook ( self , hook , net ) : try : return hook ( epoch_nr = self . current_epoch_nr , update_nr = self . current_update_nr , net = net , stepper = self . stepper , logs = self . logs ) , False except StopIteration as err : return getattr ( err , 'value' , None ) , True except Exception as e : print ( 'An error occurred while calling the "{}" hook:' . format ( hook . __name__ ) , file = sys . stderr ) print ( traceback . format_exc ( ) ) raise e
Call a hook and check if raises a stopping signal.
Call a hook and check if raises a stopping signal .
"""Call a hook and check if raises a stopping signal."""
self
hook
net