def __init__(self,
                 model,
                 index_to_token,
                 batch_size,
                 batches_num_per_epoch,
                 eval_state_per_batches=EVAL_STATE_PER_BATCHES,
                 prediction_mode_for_tests=PREDICTION_MODE_FOR_TESTS,
                 log_run_metadata=LOG_RUN_METADATA,
                 screen_log_num_test_lines=SCREEN_LOG_NUM_TEST_LINES,
                 log_candidates_num=LOG_CANDIDATES_NUM):
        """
        :param model: CakeChatModel object
        :param eval_state_per_batches: run model evaluation each `eval_state_per_batches` steps
        """
        super(CakeChatEvaluatorCallback, self).__init__(model, eval_state_per_batches)

        self._index_to_token = index_to_token
        self._token_to_index = {v: k for k, v in index_to_token.items()}

        self._val_contexts_tokens_ids = load_questions_set(self._token_to_index).x[:screen_log_num_test_lines]
        self._val_contexts = \
            transform_context_token_ids_to_sentences(self._val_contexts_tokens_ids, self._index_to_token)

        self._batch_size = batch_size
        self._batches_num = batches_num_per_epoch

        self._cur_batch_id = 0
        self._cur_loss = 0

        self._batch_start_time = None
        self._total_training_time = 0

        # logging params
        self._prediction_mode_for_tests = prediction_mode_for_tests
        self._log_run_metadata = log_run_metadata
        self._log_candidates_num = log_candidates_num

        :param model: CakeChatModel object
        :param eval_state_per_batches: run model evaluation each `eval_state_per_batches` steps
        
cakechat/dialog_model/callbacks.py