notice

This is unreleased documentation for Rasa Open Source Documentation Master/Unreleased version.
For the latest released documentation, see the latest version (2.8.x).

Version: Master/Unreleased

rasa.engine.training.hooks

TrainingHook Objects

class TrainingHook(GraphNodeHook)

Caches fingerprints and outputs of nodes during model training.

__init__

def __init__(cache: TrainingCache, model_storage: ModelStorage)

Initializes a TrainingHook.

Arguments:

  • cache - Cache used to store fingerprints and outputs.
  • model_storage - Used to cache Resources.

on_before_node

def on_before_node(node_name: Text, execution_context: ExecutionContext, config: Dict[Text, Any], received_inputs: Dict[Text, Any]) -> Dict

Calculates the run fingerprint for use in on_after_node.

on_after_node

def on_after_node(node_name: Text, execution_context: ExecutionContext, config: Dict[Text, Any], output: Any, input_hook_data: Dict) -> None

Stores the fingerprints and caches the output of the node.