    def setup_before_train(self, num_training_steps: int, init_lr: float):
        """
        Setup some configs before training.

        Args:
            num_training_steps (`int`):
                All training steps in all training loops.
            init_lr (`float`):
                Start learning rate.
        """
        self._create_optimizer(init_lr=init_lr)
        self._create_loss()
        self._create_metric()
        self._create_scheduler(num_training_steps=num_training_steps, optimizer=self.optimizer)
        self._create_callbacks()
Setup some configs before training.

Args:
num_training_steps (`int`):
All training steps in all training loops.
init_lr (`float`):
Start learning rate.
towhee/trainer/trainer.py