This is documentation for Rasa Open Source Documentation v2.0.x, which is no longer actively maintained.
For up-to-date documentation, see the latest version (2.6.x).

Version: 2.0.x


RasaModel Objects

class RasaModel(tf.keras.models.Model)

Completely override all public methods of keras Model.

Cannot be used as tf.keras.Model


| __init__(random_seed: Optional[int] = None, tensorboard_log_dir: Optional[Text] = None, tensorboard_log_level: Optional[Text] = "epoch", checkpoint_model: Optional[bool] = False, **kwargs, ,) -> None

Initialize the RasaModel.


  • random_seed - set the random seed to get reproducible results


| fit(model_data: RasaModelData, epochs: int, batch_size: Union[List[int], int], evaluate_on_num_examples: int, evaluate_every_num_epochs: int, batch_strategy: Text, silent: bool = False, loading: bool = False, eager: bool = False) -> None

Fit model data


| train_on_batch(batch_in: Union[Tuple[tf.Tensor], Tuple[np.ndarray]]) -> None

Train on batch


| @staticmethod
| batch_to_model_data_format(batch: Union[Tuple[tf.Tensor], Tuple[np.ndarray]], data_signature: Dict[Text, Dict[Text, List[FeatureSignature]]]) -> Dict[Text, Dict[Text, List[tf.Tensor]]]

Convert input batch tensors into batch data format.

Batch contains any number of batch data. The order is equal to the key-value pairs in session data. As sparse data were converted into indices, data, shape before, this methods converts them into sparse tensors. Dense data is kept.


| @staticmethod
| linearly_increasing_batch_size(epoch: int, batch_size: Union[List[int], int], epochs: int) -> int

Linearly increase batch size with every epoch.

The idea comes from