All Projects → lanpa → Tensorboardx

lanpa / Tensorboardx

Licence: mit
tensorboard for pytorch (and chainer, mxnet, numpy, ...)

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to Tensorboardx

Machine learning refined
Notes, examples, and Python demos for the textbook "Machine Learning Refined" (published by Cambridge University Press).
Stars: ✭ 750 (-89.56%)
Mutual labels:  numpy
Hcn Prototypeloss Pytorch
Hierarchical Co-occurrence Network with Prototype Loss for Few-shot Learning (PyTorch)
Stars: ✭ 17 (-99.76%)
Mutual labels:  tensorboard
Numpy neural net
A simple neural network (multilayer perceptron) with backpropagation implemented in Python with NumPy
Stars: ✭ 25 (-99.65%)
Mutual labels:  numpy
Automatic Watermark Detection
Project for Digital Image Processing
Stars: ✭ 754 (-89.51%)
Mutual labels:  numpy
Numba
NumPy aware dynamic Python compiler using LLVM
Stars: ✭ 7,090 (-1.32%)
Mutual labels:  numpy
Naivecnn
A naive (very simple!) implementation of a convolutional neural network
Stars: ✭ 18 (-99.75%)
Mutual labels:  numpy
Probabilistic robotics
solution of exercises of the book "probabilistic robotics"
Stars: ✭ 734 (-89.78%)
Mutual labels:  numpy
Pyda 2e Zh
📖 [译] 利用 Python 进行数据分析 · 第 2 版
Stars: ✭ 866 (-87.95%)
Mutual labels:  numpy
Numpy 100
100 numpy exercises (with solutions)
Stars: ✭ 7,681 (+6.9%)
Mutual labels:  numpy
Numpyro
Probabilistic programming with NumPy powered by JAX for autograd and JIT compilation to GPU/TPU/CPU.
Stars: ✭ 929 (-87.07%)
Mutual labels:  numpy
Pykaldi
A Python wrapper for Kaldi
Stars: ✭ 756 (-89.48%)
Mutual labels:  numpy
Crayon
A language-agnostic interface to TensorBoard
Stars: ✭ 776 (-89.2%)
Mutual labels:  tensorboard
Machinelearning
Machine learning algorithms implemented by pure numpy
Stars: ✭ 905 (-87.4%)
Mutual labels:  numpy
Human Detection And Tracking
Human-detection-and-Tracking
Stars: ✭ 753 (-89.52%)
Mutual labels:  numpy
Machine Learning Experiments
🤖 Interactive Machine Learning experiments: 🏋️models training + 🎨models demo
Stars: ✭ 841 (-88.3%)
Mutual labels:  numpy
Bmw Tensorflow Training Gui
This repository allows you to get started with a gui based training a State-of-the-art Deep Learning model with little to no configuration needed! NoCode training with TensorFlow has never been so easy.
Stars: ✭ 736 (-89.76%)
Mutual labels:  tensorboard
Ilearndeeplearning.py
This repository contains small projects related to Neural Networks and Deep Learning in general. Subjects are closely linekd with articles I publish on Medium. I encourage you both to read as well as to check how the code works in the action.
Stars: ✭ 896 (-87.53%)
Mutual labels:  numpy
Eliot
Eliot: the logging system that tells you *why* it happened
Stars: ✭ 874 (-87.84%)
Mutual labels:  numpy
Napari
napari: a fast, interactive, multi-dimensional image viewer for python
Stars: ✭ 847 (-88.21%)
Mutual labels:  numpy
Skydetector
A Python implementation of Sky Region Detection in a Single Image for Autonomous Ground Robot Navigation (Shen and Wang, 2013)
Stars: ✭ 23 (-99.68%)
Mutual labels:  numpy

tensorboardX

Build Status PyPI version Documentation Status Documentation Status

Write TensorBoard events with simple function call.

The current release (v2.3) is tested on anaconda3, with PyTorch 1.8.1 / torchvision 0.9.1 / tensorboard 2.5.0.

  • Support scalar, image, figure, histogram, audio, text, graph, onnx_graph, embedding, pr_curve, mesh, hyper-parameters and video summaries.

  • FAQ

Install

pip install tensorboardX

or build from source:

pip install 'git+https://github.com/lanpa/tensorboardX'

You can optionally install crc32c to speed up.

pip install crc32c

Starting from tensorboardX 2.1, You need to install soundfile for the add_audio() function (200x speedup).

pip install soundfile

Example

# demo.py

import torch
import torchvision.utils as vutils
import numpy as np
import torchvision.models as models
from torchvision import datasets
from tensorboardX import SummaryWriter

resnet18 = models.resnet18(False)
writer = SummaryWriter()
sample_rate = 44100
freqs = [262, 294, 330, 349, 392, 440, 440, 440, 440, 440, 440]

for n_iter in range(100):

    dummy_s1 = torch.rand(1)
    dummy_s2 = torch.rand(1)
    # data grouping by `slash`
    writer.add_scalar('data/scalar1', dummy_s1[0], n_iter)
    writer.add_scalar('data/scalar2', dummy_s2[0], n_iter)

    writer.add_scalars('data/scalar_group', {'xsinx': n_iter * np.sin(n_iter),
                                             'xcosx': n_iter * np.cos(n_iter),
                                             'arctanx': np.arctan(n_iter)}, n_iter)

    dummy_img = torch.rand(32, 3, 64, 64)  # output from network
    if n_iter % 10 == 0:
        x = vutils.make_grid(dummy_img, normalize=True, scale_each=True)
        writer.add_image('Image', x, n_iter)

        dummy_audio = torch.zeros(sample_rate * 2)
        for i in range(x.size(0)):
            # amplitude of sound should in [-1, 1]
            dummy_audio[i] = np.cos(freqs[n_iter // 10] * np.pi * float(i) / float(sample_rate))
        writer.add_audio('myAudio', dummy_audio, n_iter, sample_rate=sample_rate)

        writer.add_text('Text', 'text logged at step:' + str(n_iter), n_iter)

        for name, param in resnet18.named_parameters():
            writer.add_histogram(name, param.clone().cpu().data.numpy(), n_iter)

        # needs tensorboard 0.4RC or later
        writer.add_pr_curve('xoxo', np.random.randint(2, size=100), np.random.rand(100), n_iter)

dataset = datasets.MNIST('mnist', train=False, download=True)
images = dataset.test_data[:100].float()
label = dataset.test_labels[:100]

features = images.view(100, 784)
writer.add_embedding(features, metadata=label, label_img=images.unsqueeze(1))

# export scalar data to JSON for external processing
writer.export_scalars_to_json("./all_scalars.json")
writer.close()

Screenshots

Using TensorboardX with Comet

TensorboardX now supports logging directly to Comet. Comet is a free cloud based solution that allows you to automatically track, compare and explain your experiments. It adds a lot of functionality on top of tensorboard such as dataset management, diffing experiments, seeing the code that generated the results and more.

This works out of the box and just require an additional line of code. See a full code example in this Colab Notebook

Tweaks

To add more ticks for the slider (show more image history), check https://github.com/lanpa/tensorboardX/issues/44 or https://github.com/tensorflow/tensorboard/pull/1138

Reference

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].