@@ -151,6 +151,7 @@ def training_step(self, batch, batch_idx):
151151
152152import inspect
153153from abc import ABC , abstractmethod
154+ import warnings
154155
155156import numpy as np
156157
@@ -169,22 +170,22 @@ class TrainerTrainLoopMixin(ABC):
169170 def __init__ (self ):
170171 # this is just a summary on variables used in this abstract class,
171172 # the proper values/initialisation should be done in child class
172- self .max_nb_epochs = None
173+ self .max_epochs = None
174+ self .min_epochs = None
173175 self .use_ddp = None
174176 self .use_dp = None
175177 self .use_ddp2 = None
176178 self .single_gpu = None
177179 self .data_parallel_device_ids = None
178180 self .check_val_every_n_epoch = None
179- self .nb_training_batches = None
181+ self .num_training_batches = None
180182 self .val_check_batch = None
181- self .nb_val_batches = None
183+ self .num_val_batches = None
182184 self .fast_dev_run = None
183185 self .is_iterable_train_dataloader = None
184186 self .main_progress_bar = None
185187 self .accumulation_scheduler = None
186188 self .lr_schedulers = None
187- self .min_nb_epochs = None
188189 self .enable_early_stop = None
189190 self .early_stop_callback = None
190191 self .callback_metrics = None
@@ -194,7 +195,7 @@ def __init__(self):
194195 self .log_save_interval = None
195196 self .proc_rank = None
196197 self .row_log_interval = None
197- self .total_batch_nb = None
198+ self .total_batches = None
198199 self .truncated_bptt_steps = None
199200 self .optimizers = None
200201 self .accumulate_grad_batches = None
@@ -207,6 +208,24 @@ def __init__(self):
207208 self .get_train_dataloader = None
208209 self .reduce_lr_on_plateau_scheduler = None
209210
211+ @property
212+ def max_nb_epochs (self ):
213+ """
214+ .. warning:: `max_nb_epochs` is deprecated and will be removed in v0.8.0, use `max_epochs` instead.
215+ """
216+ warnings .warn ("`max_nb_epochs` is deprecated and will be removed in "
217+ "v0.8.0, use `max_epochs` instead." , DeprecationWarning )
218+ return self .max_epochs
219+
220+ @property
221+ def min_nb_epochs (self ):
222+ """
223+ .. warning:: `min_nb_epochs` is deprecated and will be removed in v0.8.0, use `min_epochs` instead.
224+ """
225+ warnings .warn ("`min_nb_epochs` is deprecated and will be removed in "
226+ "v0.8.0, use `min_epochs` instead." , DeprecationWarning )
227+ return self .min_epochs
228+
210229 @abstractmethod
211230 def get_model (self ):
212231 # this is just empty shell for code from other class
@@ -391,7 +410,7 @@ def run_training_epoch(self):
391410 if early_stop_epoch or self .fast_dev_run :
392411 break
393412
394- # stop epoch if we limited nb batches
413+ # stop epoch if we limited the number of training batches
395414 met_batch_limit = batch_idx >= self .num_training_batches
396415 if met_batch_limit :
397416 break
0 commit comments