Simplified base logger's API
See original GitHub issue🚀 Feature
Idea is to simplify current logger’s API by creating a shortcut methods: Currently, to log output parameters and optmizer’s params we do (example is for TB, but is generic for others too):
logger = TensorboardLogger(...)
logger.attach(
trainer,
log_handler=OutputHandler(tag="training", metric_names="all"),
event_name=Events.ITERATION_COMPLETED(every=log_every_iters),
)
logger.attach(
trainer,
log_handler=OptimizerParamsHandler(optimizer, param_name="lr", tag=k),
event_name=Events.ITERATION_STARTED(every=log_every_iters),
)
Proposed API:
logger = TensorboardLogger(...)
logger.attach_output_handler(
trainer,
tag="training", metric_names="all", # other args, kwargs of OutputHandler
event_name=Events.ITERATION_COMPLETED(every=log_every_iters),
)
logger.attach_opt_params_handler(
trainer,
optimizer, param_name="lr", tag=k, # other args, kwargs of OutputHandler
event_name=Events.ITERATION_STARTED(every=log_every_iters),
)
In addition, this can fix “bad-practice” current implementation of setup_any_logging
taking as input logger and logging_module:
https://github.com/pytorch/ignite/blob/d1aa5fd5e71676032c952aa7470a651c216e2dd9/ignite/contrib/engines/common.py#L209
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Basic plugin: Using loggers to simplify debugging
Using Logger APIs. This is the recommended way for logging in plugins. All plugin instances have a logger property: using BepInEx; namespace MyFirstPlugin ......
Read more >Add a verbalize logger to your base application. - GitHub
Contribute to base/base-logger development by creating an account on GitHub. ... Adds logger and mode methods to the app directly for easy logging....
Read more >API Gateway logging - simplified - Knowledge base
Logs from different components like API Gateway Server, API Gateway UI, Internal Data Store, Security, Session, Platform , Wrapper.
Read more >logging — Logging facility for Python — Python 3.11.1 ...
This module defines functions and classes which implement a flexible event logging system for applications and libraries. The key benefit of having the...
Read more >API as a package: Logging - Jumping Rivers
In this installment of the series we look at adding some functions to our package that will take care of logging as our...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@sdesrozis it’s too hacky for me, such approach.
Let’s implement the methods
logger.attach_output_handler
andlogger.attach_opt_params_handler
. Anyone would like to work on it ?I will do it this week-end if nobody does 😉