Skip to content

Commit

Permalink
docs: minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
yoptar committed Nov 28, 2019
1 parent ba2f438 commit aeafdcf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions deeppavlov/core/trainers/nn_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class NNTrainer(FitTrainer):
train_metrics: metrics calculated for train logs (if omitted, ``metrics`` argument is used)
metric_optimization: one of ``'maximize'`` or ``'minimize'`` — strategy for metric optimization used in early
stopping (default is ``'maximize'``)
evaluation_targets: data types on which to evaluate trained pipeline (default is ``('valid', 'test')``)
evaluation_targets: data types on which to evaluate a trained pipeline (default is ``('valid', 'test')``)
show_examples: a flag used to print inputs, expected outputs and predicted outputs for the last batch
in evaluation logs (default is ``False``)
tensorboard_log_dir: path to a directory where tensorboard logs can be stored, ignored if None
Expand All @@ -75,7 +75,7 @@ class NNTrainer(FitTrainer):
**kwargs: additional parameters whose names will be logged but otherwise ignored
Trainer saves the model if it sees a progress in scores. The full rules look like following:
Trainer saves the model if it sees progress in scores. The full rules look like following:
- For the validation savepoint:
* 0-th validation (optional). Don't save model, establish a baseline.
Expand Down Expand Up @@ -143,7 +143,7 @@ def _improved(op):
self.patience = 0
self.last_result = {}
self.losses = []
self.start_time = None # type:Optional[float]
self.start_time: Optional[float] = None

if self.tensorboard_log_dir is not None:
self.tb_train_writer = self._tf.summary.FileWriter(str(self.tensorboard_log_dir / 'train_log'))
Expand Down Expand Up @@ -208,7 +208,7 @@ def _validate(self, iterator: DataLearningIterator,
log.info('Saving model')
self.save()
else:
log.info('Did not improved on the {} of {}'.format(m_name, self.score_best))
log.info('Did not improve on the {} of {}'.format(m_name, self.score_best))

report['impatience'] = self.patience
if self.validation_patience > 0:
Expand Down
2 changes: 1 addition & 1 deletion deeppavlov/dataset_readers/file_paths_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def _get_files(self, data_path, tgt):
paths = Path(data_path).resolve().glob(tgt)
files = [file for file in paths if Path(file).is_file()]
paths_info = Path(data_path, tgt).absolute().as_posix()
if not (files):
if not files:
raise Exception(f"Not find files. Data path '{paths_info}' does not exist or does not hold files!")
else:
log.info(f"Found {len(files)} files located '{paths_info}'.")
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Welcome to DeepPavlov's documentation!
Amazon Alexa integration <integrations/amazon_alexa>
Microsoft Bot Framework integration <integrations/ms_bot>
Amazon AWS deployment <integrations/aws_ec2>
Deeppavlov settings <integrations/settings>
DeepPavlov settings <integrations/settings>


.. toctree::
Expand Down

0 comments on commit aeafdcf

Please sign in to comment.