rasa/core/policies/embedding_policy.py
def continue_training(self,
                          training_trackers: List[DialogueStateTracker],
                          domain: Domain,
                          **kwargs: Any) -> None:
        """Continue training an already trained policy."""

        batch_size = kwargs.get("batch_size", 5)
        epochs = kwargs.get("epochs", 50)

        for _ in range(epochs):
            training_data = self._training_data_for_continue_training(
                batch_size, training_trackers, domain)

            session_data = self._create_tf_session_data(domain,
                                                        training_data.X,
                                                        training_data.y)

            b = self._create_batch_b(session_data.Y,
                                     session_data.actions_for_Y)

            batch_loss_scales = self._scale_loss_by_count_actions(
                session_data.X,
                session_data.slots,
                session_data.previous_actions,
                session_data.actions_for_Y
            )

            # fit to one extra example using updated trackers
            self.session.run(
                self._train_op,
                feed_dict={
                    self.a_in: session_data.X,
                    self.b_in: b,
                    self.c_in: session_data.slots,
                    self.b_prev_in: session_data.previous_actions,
                    self._dialogue_len: session_data.X.shape[1],
                    self._x_for_no_intent_in:
                        session_data.x_for_no_intent,
                    self._y_for_no_action_in:
                        session_data.y_for_no_action,
                    self._y_for_action_listen_in:
                        session_data.y_for_action_listen,
                    self._is_training: True,
                    self._loss_scales: batch_loss_scales
                }
            )
Continue training an already trained policy.
Continue training an already trained policy.
Continue training an already trained policy .
def continue_training(self,
                          training_trackers: List[DialogueStateTracker],
                          domain: Domain,
                          **kwargs: Any) -> None:
        batch_size = kwargs.get("batch_size", 5)
        epochs = kwargs.get("epochs", 50)
        for _ in range(epochs):
            training_data = self._training_data_for_continue_training(
                batch_size, training_trackers, domain)
            session_data = self._create_tf_session_data(domain,
                                                        training_data.X,
                                                        training_data.y)
            b = self._create_batch_b(session_data.Y,
                                     session_data.actions_for_Y)
            batch_loss_scales = self._scale_loss_by_count_actions(
                session_data.X,
                session_data.slots,
                session_data.previous_actions,
                session_data.actions_for_Y
            )
            self.session.run(
                self._train_op,
                feed_dict={
                    self.a_in: session_data.X,
                    self.b_in: b,
                    self.c_in: session_data.slots,
                    self.b_prev_in: session_data.previous_actions,
                    self._dialogue_len: session_data.X.shape[1],
                    self._x_for_no_intent_in:
                        session_data.x_for_no_intent,
                    self._y_for_no_action_in:
                        session_data.y_for_no_action,
                    self._y_for_action_listen_in:
                        session_data.y_for_action_listen,
                    self._is_training: True,
                    self._loss_scales: batch_loss_scales
                }
            )
def continue_training ( self , training_trackers : List [ DialogueStateTracker ] , domain : Domain , ** kwargs : Any ) -> None : batch_size = kwargs . get ( "batch_size" , 5 ) epochs = kwargs . get ( "epochs" , 50 ) for _ in range ( epochs ) : training_data = self . _training_data_for_continue_training ( batch_size , training_trackers , domain ) session_data = self . _create_tf_session_data ( domain , training_data . X , training_data . y ) b = self . _create_batch_b ( session_data . Y , session_data . actions_for_Y ) batch_loss_scales = self . _scale_loss_by_count_actions ( session_data . X , session_data . slots , session_data . previous_actions , session_data . actions_for_Y ) self . session . run ( self . _train_op , feed_dict = { self . a_in : session_data . X , self . b_in : b , self . c_in : session_data . slots , self . b_prev_in : session_data . previous_actions , self . _dialogue_len : session_data . X . shape [ 1 ] , self . _x_for_no_intent_in : session_data . x_for_no_intent , self . _y_for_no_action_in : session_data . y_for_no_action , self . _y_for_action_listen_in : session_data . y_for_action_listen , self . _is_training : True , self . _loss_scales : batch_loss_scales } )
Continue training an already trained policy.
Continue training an already trained policy .
"""Continue training an already trained policy.""" # fit to one extra example using updated trackers
self
training_trackers
List[DialogueStateTracker]
domain
Domain
kwargs
Any