Skip to main content

Atalaya

This framework provides a logger for pytorch models, it allows you to save the parameters, the state of the network, the state of the optimizer and allows also to visualize your data using tensorboardX or visdom.

Install

pip install atalaya

Example

Examples are provided in examples directory, where we simply add the logger to an example of a pytorch implemetation (source) in example_1. In each directory you have also the files created by the logger. There is a directory named logs and one named vizualize. The first one contains the logs of each experiment and the second one the files needed to visualize e.g. in tensorboard.

Init

from atalaya import Logger

logger = Logger()

# by default Logger uses tensorboardX as graher
# you can use visdom by changing the default value
logger = Logger(grapher='visdom')

Parameters

You can add parameters (save directly when addParams is called), you can also load parameters from a previous experiment.

args = parser.parse_args()

# add parameters to the logger
logger.add_parameters(args)

# load from previous experiment
args = logger.restore_parameters(args.path_of_previous_experiment)

Informations

You can log information instead of use print, this way you will see the information in terminal and it will also be logged in train.log file for a later consultation.

logger.info("message to log and print", "like in a print")

# you can also use it for warnings
logger.warning("message")

store and restore (models and optimizers)

To save checkpoints and the best model you need to call save method in traning loop. You can choose with wich frequency to save a checkpoint and if we want to overwrite the previous and keep always the last saved.

# before store, you need to add to the logger all you want to store using the logger.add('name', object) method

logger.add('model', model)
logger.add('optimizer', optimizer)

# and in the training loop
for epoch in epochs:
    ...
    # pay attention it really recomended to keep overwrite=True
    # if not you may have memory problems if e.g. you save your model
    # every epoch and you have 2000 epochs
    logger.store(train_loss, val_loss, save_every=1, overwrite=True)

And after the training you can load the best model and test it or before training you can load from a previous experience.

logger.restore(best=True)
#or
logger.restore(path_to_a_checkpoint)

visualizer

This logger as a wrapper to tensorboardX and visdom. It allows you to better visualize your experiments. By default, for visdom, the server is localhost and the port is 8097. You can change them if you want when you intitialize the Logger.

# to add a scalar
logger.add_scalar('my_scalar', value, epoch)

# to add many scalars in a dictionary
values = {'train_loss':train_loss_values, 'val_loss':val_loss_values}
logger.register_plots(values, epoch, prefix='train', apply_mean=True)

Metadata

Release files for atalaya 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for atalaya 0.1.3
File Size Uploaded
atalaya-0.1.3.tar.gz 11.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for atalaya 0.1.3
File Interpreter ABI Platform
atalaya-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 23.4 kB

Release files / atalaya-0.1.3.tar.gz

Download URL atalaya-0.1.3.tar.gz
Size 11.5 kB
Tags Source
SHA-256 checksum
How to use checksums
77ec9d773c6a7bcca4efe7df588870492057739f25cb2ca496e4ad428d492634
BLAKE2b-256 checksum
How to use checksums
bb5bed7cd37d07c908cb66e31df61d9980a7ea3926bf72dfa4f42a8b87eb0267
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.5

Release files / atalaya-0.1.3-py3-none-any.whl

Download URL atalaya-0.1.3-py3-none-any.whl
Size 11.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2064bb03c59807dd0f96f119c41b51c257dcfa7479f7eda4b6daf2c4c7580cc3
BLAKE2b-256 checksum
How to use checksums
bd8d0323a9101e2c95a62ed831a470d0f0580d19b624cc799dddc0aee9d0372c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.5

Release history Release notifications | RSS feed

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.4

2 release files

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page