All Projects → LiyuanLucasLiu → Torch-Scope

LiyuanLucasLiu / Torch-Scope

Licence: Apache-2.0 license
A Toolkit for Training, Tracking, Saving Models and Syncing Results

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Torch-Scope

flor
FLOR: Fast Low-Overhead Recovery. FLOR lets you log ML training data post-hoc, with hindsight.
Stars: ✭ 123 (+98.39%)
Mutual labels:  logger, tensorboard
ng-logger
Angular logger service
Stars: ✭ 65 (+4.84%)
Mutual labels:  logger
Bioperl Live
Core BioPerl 1.x code
Stars: ✭ 244 (+293.55%)
Mutual labels:  toolkit
QuickTraceiOSLogger
A real time iOS log trace tool, view iOS log with pc web browser under local area network, which will automatically scroll like xcode. 一个实时的iOS日志跟踪工具,在局域网中使用 PC Web 浏览器查看 iOS 日志,它将像xcode一样自动滚动。
Stars: ✭ 16 (-74.19%)
Mutual labels:  logger
Framevuerk
Fast, Responsive, Multi Language, Both Direction Support and Configurable UI Framework based on Vue.js.
Stars: ✭ 252 (+306.45%)
Mutual labels:  toolkit
log
Aplus Framework Log Library
Stars: ✭ 14 (-77.42%)
Mutual labels:  logger
Mercury
Mercury is a hacking tool used to collect information and use the information to further hurt the target
Stars: ✭ 236 (+280.65%)
Mutual labels:  toolkit
sinling
A collection of NLP tools for Sinhalese (සිංහල).
Stars: ✭ 38 (-38.71%)
Mutual labels:  toolkit
design-react-kit
A React toolkit that implements the Italia design system
Stars: ✭ 134 (+116.13%)
Mutual labels:  toolkit
datalogger
DataLogger foi projetado para ser uma biblioteca simples de log com suporte a vários providers.
Stars: ✭ 46 (-25.81%)
Mutual labels:  logger
blog
个人博客,关注前端工程化及移动端
Stars: ✭ 17 (-72.58%)
Mutual labels:  toolkit
dt-utils
前端常用工具函数
Stars: ✭ 23 (-62.9%)
Mutual labels:  toolkit
VIZIA
A declarative GUI library written in Rust
Stars: ✭ 551 (+788.71%)
Mutual labels:  toolkit
Jfa Pwa Toolkit
⚡️ PWA Features to Any Website (very Fast & Easy)
Stars: ✭ 245 (+295.16%)
Mutual labels:  toolkit
IMS-Toucan
Text-to-Speech Toolkit of the Speech and Language Technologies Group at the University of Stuttgart. Objectives of the development are simplicity, modularity, controllability and multilinguality.
Stars: ✭ 295 (+375.81%)
Mutual labels:  toolkit
Pk3ds
Pokémon (3DS) ROM Editor & Randomizer
Stars: ✭ 244 (+293.55%)
Mutual labels:  toolkit
mini-async-log-c
Mini async log C port. Now with C++ wrappers.
Stars: ✭ 69 (+11.29%)
Mutual labels:  logger
nightingale
NHS-Generic Frontend Framework.
Stars: ✭ 34 (-45.16%)
Mutual labels:  toolkit
checkmate
Training neural networks in TensorFlow 2.0 with 5x less memory
Stars: ✭ 116 (+87.1%)
Mutual labels:  gpu-memory
junit.testlogger
JUnit test logger for vstest platform
Stars: ✭ 61 (-1.61%)
Mutual labels:  logger

Torch-Scope

License Documentation Status Downloads PyPI version

A Toolkit for training pytorch models, which has three features:

  • Tracking environments, dependency, implementations and checkpoints;
  • Providing a logger wrapper with two handlers (to std and file);
  • Supporting automatic device selection;
  • Providing a tensorboard wrapper;
  • Providing a spreadsheet writer to automatically summarizing notes and results;

We are in an early-release beta. Expect some adventures and rough edges.

Quick Links

Installation

To install via pypi:

pip install torch-scope

To build from source:

pip install git+https://github.com/LiyuanLucasLiu/Torch-Scope

or

git clone https://github.com/LiyuanLucasLiu/Torch-Scope.git
cd Torch-Scope
python setup.py install

Usage

An example is provided as below, please read the doc for a detailed api explaination.

  • set up the git in the server & add all source file to the git
  • use tensorboard to track the model stats (tensorboard --logdir PATH/log/ --port ####)
from torch_scope import wrapper
...
logger = logging.getLogger(__name__)

if __name__ == '__main__':

    parser = argparse.ArgumentParser()

    parser.add_argument('--checkpoint_path', type=str, ...)
    parser.add_argument('--name', type=str, ...)
    parser.add_argument('--gpu', type=str, ...)
    ...
    args = parser.parse_args()

    pw = wrapper(os.path.join(args.checkpoint_path, args.name), name = args.log_dir, enable_git_track = False)
    # Or if the current folder is binded with git, you can turn on the git tracking as below
    # pw = wrapper(os.path.join(args.checkpoint_path, args.name), name = args.log_dir, enable_git_track = True)
    # if you properly set the path to credential_path and want to use spreadsheet writer, turn on sheet tracking as below
    # pw = wrapper(os.path.join(args.checkpoint_path, args.name), name = args.log_dir, \
    #             enable_git_track=args.git_tracking, sheet_track_name=args.spreadsheet_name, \ 
    #             credential_path="/data/work/jingbo/ll2/Torch-Scope/torch-scope-8acf12bee10f.json")
    
    
    gpu_index = pw.auto_device() if 'auto' == args.gpu else int(args.gpu)
    device = torch.device("cuda:" + str(gpu_index) if gpu_index >= 0 else "cpu")

    pw.save_configue(args) # dump the config to config.json

    # if the spreadsheet writer is enabled, you can add a description about the current model
    # pw.add_description(args.description) 

    logger.info(str(args)) # would be plotted to std & file if level is 'info' or lower

    ...

    batch_index = 0

    for index in range(epoch):

    	...

    	for instance in ... :

    		loss = ...

    		tot_loss += loss.detach()
    		loss.backward()

    		if batch_index % ... = 0:
    			pw.add_loss_vs_batch({'loss': tot_loss / ..., ...}, batch_index, False)
    			pw.add_model_parameter_stats(model, batch_index, save=True)
    			optimizer.step()
    			pw.add_model_update_stats(model, batch_index)
    			tot_loss = 0
    		else:
    			optimizer.step()

    		batch_index += 1

    	dev_score = ...
    	pw.add_loss_vs_batch({'dev_score': dev_score, ...}, index, True)

    	if dev_score > best_score:
    		pw.save_checkpoint(model, optimizer, is_best = True)
    		best_score = dev_score
    	else:
    		pw.save_checkpoint(model, optimizer, is_best = False)

Advanced Usage

Auto Device

Git Tracking

Spreadsheet Logging

Share the spreadsheet with the following account [email protected]. And access the table with its name.

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].