DOC: fix spelling and grammar in tqdm_logger#3779
Conversation
vfdev-5
left a comment
There was a problem hiding this comment.
Thanks for the PR @importstring
I left comments to revert some unnecessary changes
| pbar.attach(trainer, ['loss']) | ||
|
|
||
| # Progress bar will looks like | ||
|
|
There was a problem hiding this comment.
Let's remove the new line
There was a problem hiding this comment.
There are three instances of this.
Previously
Simple progress bar
.. code-block:: python
trainer = create_supervised_trainer(model, optimizer, loss)
pbar = ProgressBar()
pbar.attach(trainer)
# Progress bar will looks like
# Epoch [2/50]: [64/128] 50%|█████ [06:17<12:34]
Log output to a file instead of stderr (tqdm's default output)
.. code-block:: python
trainer = create_supervised_trainer(model, optimizer, loss)
log_file = open("output.log", "w")
pbar = ProgressBar(file=log_file)
pbar.attach(trainer)
Attach metrics that already have been computed at :attr:`~ignite.engine.events.Events.ITERATION_COMPLETED`
(such as :class:`~ignite.metrics.RunningAverage`)
.. code-block:: python
trainer = create_supervised_trainer(model, optimizer, loss)
RunningAverage(output_transform=lambda x: x).attach(trainer, 'loss')
pbar = ProgressBar()
pbar.attach(trainer, ['loss'])
# Progress bar will looks like
# Epoch [2/50]: [64/128] 50%|█████ , loss=0.123 [06:17<12:34]
Directly attach the engine's output
.. code-block:: python
trainer = create_supervised_trainer(model, optimizer, loss)
pbar = ProgressBar()
pbar.attach(trainer, output_transform=lambda x: {'loss': x})
# Progress bar will looks like
# Epoch [2/50]: [64/128] 50%|█████ , loss=0.123 [06:17<12:34]I think the version history got a bit messed up which is why it shows I deleted the line instead showing the grammar edit.
Would you like me to remove all # Progress bar will looks like, keep them all, or just remove that one?
For now I've fixed the spelling of all three and kept all three. Let me know what you'd prefer.
Co-authored-by: vfdev <vfdev.5@gmail.com>
Removed comment about the progress bar appearance.
Fixed formatting in docstring for persist argument.
|
Thanks for the review, @vfdev-5. I’ve applied all your suggestions (reverted the unnecessary formatting/capitalization changes and the extra test file) and kept only the focused spelling/grammar fixes in tqdm_logger.py. Happy to tweak further if needed. |
Added a comment to clarify the progress bar output format.
|
@importstring hi, one of you string update broke an tests regrex, specifically |
|
Hi @aaishwarymishra |
|
It's coming from this test case because we changed contrib module to submodule: try:
from tqdm.autonotebook import tqdm
except ImportError:
raise ModuleNotFoundError(
"This submodule requires tqdm to be installed. Please install it with the command: \n pip install tqdm"
)I can either change it back to "This contrib module requires tqdm to be installed. Please install it with command: \n pip install tqdm"or I can update the tests but then the scope would be greater. Happy to do whichever you prefer. For now I've updated the test to match the new error message @vfdev-5 requested. |
vfdev-5 suggested I change the error string for accuracy but this introduced a bug only found when testing. This fixes the test.

Found and fixed several spelling and grammar errors in comments and docstrings in
tqdm_logger.py. No logic or behaviour was changed.One example:
Found these issues while working on #3118.
Spelling and grammar suggestions were assisted by an AI tool; all changes were manually reviewed and hand-typed.cc @vfdev-5