Skip to main content

A Toolkit for a series of Young projects

Project description

YoungToolkit

A Toolkit for a series of Young projects, these modules are very practical, basic, simple and easy to use, so you can import this package wherever you need to use it.

Usage

from yoolkit.some_module import *

See Full Documentation for more details.

Table of Contents

visualizing

This module is a encapsulation of the client side of visdom, note that the visdom server API adheres to the Plotly convention of data and layout objects.

Visualizing Server

If you have not host a server of the visdom for yourself, please follow the instructions below.

export VISDOM_USERNAME="Jason"
export VISDOM_PASSWORD="123456"
export VISDOM_COOKIE="Guest_Visdom_Cookie"

function start_visdom {
    VISDOM_USE_ENV_CREDENTIALS=1 visdom -port 6789 -enable_login -force_new_cookie;
}

export -f start_visdom

nohup bash -c start_visdom > visdom.log 2>&1 &

or you can download the start and stop scripts for convenience.

Visualizing Client
  1. Setup visualizing client for the server you host (assume your host ip is 127.0.0.1):
from yoolkit.visualizing import setup_visualizer
visualizer = setup_visualizer(
    'Demo',
    server='127.0.0.1',
    port=6789,
    username="Jason",
    password="123456",
    logging_path="demo.log",
    offline=False,
    overwrite=True
)
  1. Open connection:
visualizer.open()
  1. Draw! Your paintings can be found at http://127.0.0.1:6789.
import numpy
heat = numpy.arange(25).reshape((5,5))
visualizer.visualize(
    'heatmap',
    'demo_heatmap_5_5',
    'Demo 5*5 matrix heatmap',
    X=heat,
    opts={
        'colormap': 'Viridis',
    }
)

In method visualizer.visualize(), No.1 argument visualize_type is one of a methods of visdom like line, heatmap, mesh, etc., No.2 and No.3 arugment is visualize_name and visualize_title, all other keyword arguments is determined by visualize_type (refer to visdom for more detailed usage documentation).

  1. Close connection:
visualizer.close()

After you close the connection between client and server, the server will remove the paintings that you have drawn. Don't worry about that, all the paintings are saved in the logging file demo.log which is defined in step 1.

  1. Replay a logging file:
visualizer.replay_log('some_other.log')

Installation

Three different installation methods are shown bellow:

  1. Install YoungToolkit or youngtoolkit from PyPI:
pip install YoungToolkit

or

pip install youngtoolkit
  1. Install YoungToolkit from sources:
git clone https://github.com/Jason-Young-AI/YoungToolkit.git
cd YoungToolkit
python setup.py install
  1. Develop YoungToolkit locally:
git clone https://github.com/Jason-Young-AI/YoungToolkit.git
cd YoungToolkit
python setup.py build develop

Installation with NVIDIA related functions supports

Support IO for PyTorch Tensors

Append [nv-io] to the package name YoungToolkit durning the installation, like:

pip install YoungToolkit[nv-io]

Support Tracking of the GPU memory (PyTorch)

Append [nv-track] to the package name YoungToolkit durning the installation.

pip install YoungToolkit[nv-track]

NOTE: I refer to project(Oldpan/Pytorch-Memory-Utils) to implement this part yoolkit.tracker

Support all features

Append [full] to the package name YoungToolkit durning the installation.

pip install YoungToolkit[full]

NOTATION : If you are using zsh as your shell environment, please escape the square brackets or quote the argument like pip install 'YoungToolkit[xxx]'. (Here is a more detailed explanation)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

YoungToolkit-0.1.3.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

YoungToolkit-0.1.3-py3-none-any.whl (20.0 kB view details)

Uploaded Python 3

File details

Details for the file YoungToolkit-0.1.3.tar.gz.

File metadata

  • Download URL: YoungToolkit-0.1.3.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.0.post20201006 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5

File hashes

Hashes for YoungToolkit-0.1.3.tar.gz
Algorithm Hash digest
SHA256 b50c408360127a544b38656d084e2d5a44dc161d8cff905f69419755bd79a26f
MD5 b5d20dac76f758dd22fa11b6c565d5bc
BLAKE2b-256 2e3639a914c00b314910ebd48c92fe61c2ab3c05e6508b78a1f779a1584b0540

See more details on using hashes here.

File details

Details for the file YoungToolkit-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: YoungToolkit-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 20.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.0.post20201006 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5

File hashes

Hashes for YoungToolkit-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5cc974dcb1e938a91177d8151acd4da8b619c1c31a3c5c972a0aa10d6ae4741e
MD5 b59890ff9aecc83a75484b980f6ab820
BLAKE2b-256 c1e058f57efe68dc0758fa9779d43aea8cb60cb26c5b086d2a78100eeaf6fabb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page