brainstorm/training/trainer.py
def add_hook(self, hook):
        """Add a hook to this trainer.

        Hooks add a variety of functionality to the trainer and can be
        called after every specified number of parameter updates or epochs.
        See documentation for ::class::`Hook` for more details.

        Note:
            During training, hooks will be called in the same order that they
            were added. This should be kept in mind when using a hook which
            relies on another hook having been called.
        Args:
            hook (brainstorm.hooks.Hook): Any ::class::`Hook` object that
                                          should be called by this trainer.
        Raises:
            ValueError: If a hook with the same name has already been added.
        """
        if hook.__name__ in self.hooks:
            raise ValueError("Hook '{}' already exists.".format(hook.__name__))
        self.hooks[hook.__name__] = hook
        hook.priority = max([h.priority for h in self.hooks.values()]) + 1
Add a hook to this trainer.

        Hooks add a variety of functionality to the trainer and can be
        called after every specified number of parameter updates or epochs.
        See documentation for ::class::`Hook` for more details.

        Note:
            During training, hooks will be called in the same order that they
            were added. This should be kept in mind when using a hook which
            relies on another hook having been called.
        Args:
            hook (brainstorm.hooks.Hook): Any ::class::`Hook` object that
                                          should be called by this trainer.
        Raises:
            ValueError: If a hook with the same name has already been added.
        
Add a hook to this trainer.
Hooks add a variety of functionality to the trainer and can be
called after every specified number of parameter updates or epochs.
See documentation for ::class::`Hook` for more details.

During training, hooks will be called in the same order that they
were added. This should be kept in mind when using a hook which
relies on another hook having been called.
Add a hook to this trainer . Hooks add a variety of functionality to the trainer and can be called after every specified number of parameter updates or epochs . See documentation for :: class :: ` Hook ` for more details . During training hooks will be called in the same order that they were added . This should be kept in mind when using a hook which relies on another hook having been called .
def add_hook(self, hook):
        if hook.__name__ in self.hooks:
            raise ValueError("Hook '{}' already exists.".format(hook.__name__))
        self.hooks[hook.__name__] = hook
        hook.priority = max([h.priority for h in self.hooks.values()]) + 1
def add_hook ( self , hook ) : if hook . __name__ in self . hooks : raise ValueError ( "Hook '{}' already exists." . format ( hook . __name__ ) ) self . hooks [ hook . __name__ ] = hook hook . priority = max ( [ h . priority for h in self . hooks . values ( ) ] ) + 1
Add a hook to this trainer.
Add a hook to this trainer .
"""Add a hook to this trainer.

        Hooks add a variety of functionality to the trainer and can be
        called after every specified number of parameter updates or epochs.
        See documentation for ::class::`Hook` for more details.

        Note:
            During training, hooks will be called in the same order that they
            were added. This should be kept in mind when using a hook which
            relies on another hook having been called.
        Args:
            hook (brainstorm.hooks.Hook): Any ::class::`Hook` object that
                                          should be called by this trainer.
        Raises:
            ValueError: If a hook with the same name has already been added.
        """
If a hook with the same name has already been added.
If a hook with the same name has already been added .
ValueError
self
hook
Any ::class::`Hook` object that
should be called by this trainer.
Any :: class :: ` Hook ` object that should be called by this trainer .