Example #1
0
def show_mpl():
    cli = tw.WatcherClient()
    st_isum = cli.open_stream('isums')
    st_rsum = cli.open_stream('rsums')
    
    line_plot = tw.Visualizer(st_isum, vis_type='line', xtitle='i', ytitle='isum')
    line_plot.show()

    line_plot2 = tw.Visualizer(st_rsum, vis_type='line', host=line_plot, ytitle='rsum')

    tw.plt_loop()
Example #2
0
def reader3():
    print('---------------------------reader3---------------------------')

    watcher = tw.Watcher(filename=r'c:\temp\test.log', port=None)
    stream1 = watcher.open_stream('metric1')
    stream2 = watcher.open_stream('metric2')

    vis1 = tw.Visualizer(stream1, vis_type='line')
    vis2 = tw.Visualizer(stream2, vis_type='line', host=vis1)

    vis1.show()

    tw.plt_loop()
Example #3
0
def text_stats():
    train_cli = tw.WatcherClient()
    stream = train_cli.create_stream(
        event_name="batch", expr='lambda d:(d.x, d.metrics.batch_loss)')

    trl = tw.Visualizer(stream, vis_type=None)
    trl.show()
    input('Paused...')
Example #4
0
def dynamic_hist():
    w = tw.Watcher()
    s = w.create_stream()

    v = tw.Visualizer(s, vis_type='histogram', bins=6, clear_after_each=True)
    v.show()

    for _ in range(100):
        s.write([random.random() * 10 for _ in range(100)])
        tw.plt_loop(count=3)
Example #5
0
def dynamic_bar():
    w = tw.Watcher()
    s = w.create_stream()

    v = tw.Visualizer(s, vis_type='bar', clear_after_each=True)
    v.show()

    for i in range(100):
        s.write([('a' + str(i), random.random() * 10) for i in range(10)])
        tw.plt_loop(count=3)
Example #6
0
def static_hist():
    w = tw.Watcher()
    s = w.create_stream()

    v = tw.Visualizer(s, vis_type='histogram', bins=6)
    v.show()

    for _ in range(100):
        s.write(random.random() * 10)

    tw.plt_loop()
Example #7
0
def static_bar():
    w = tw.Watcher()
    s = w.create_stream()

    v = tw.Visualizer(s, vis_type='bar')
    v.show()

    for i in range(10):
        s.write(int(random.random() * 10))

    tw.plt_loop()
Example #8
0
def dynamic_line3d():
    w = tw.Watcher()
    s = w.create_stream()

    v = tw.Visualizer(s, vis_type='line3d', clear_after_each=True)
    v.show()

    for i in range(100):
        s.write([(i, random.random() * 10, z) for i in range(10)
                 for z in range(10)])
        tw.plt_loop(count=3)
Example #9
0
def dynamic_pie():
    w = tw.Watcher()
    s = w.create_stream()

    v = tw.Visualizer(s, vis_type='pie', bins=6, clear_after_each=True)
    v.show()

    for _ in range(100):
        s.write([('label' + str(i), random.random() * 10, None, i * 0.01)
                 for i in range(12)])
        tw.plt_loop(count=3)
Example #10
0
def static_pie():
    w = tw.Watcher()
    s = w.create_stream()

    v = tw.Visualizer(s, vis_type='pie', bins=6)
    v.show()

    for i in range(6):
        s.write(('label' + str(i), random.random() * 10, None,
                 0.5 if i == 3 else 0))

    tw.plt_loop()
Example #11
0
def batch_stats():
    train_cli = tw.WatcherClient()
    stream = train_cli.create_stream(
        event_name="batch",
        expr='lambda v:(v.metrics.epochf, v.metrics.batch_loss)',
        throttle=0.75)

    train_loss = tw.Visualizer(stream,
                               clear_after_end=False,
                               vis_type='mpl-line',
                               xtitle='Epoch',
                               ytitle='Train Loss')

    #train_acc = tw.Visualizer('lambda v:(v.metrics.epochf, v.metrics.epoch_loss)', event_name="batch",
    #                     xtitle='Epoch', ytitle='Train Accuracy', clear_after_end=False, yrange=(0,1),
    #                     vis=train_loss, vis_type='mpl-line')

    train_loss.show()
    tw.image_utils.plt_loop()
Example #12
0
import tensorwatch as tw

stream = tw.ArrayStream([(i, i*i) for i in range(50)])
img_plot = tw.Visualizer(stream, vis_type='mpl-line', viz_img_scale=3, xtitle='Epochs', ytitle='Gain')
# img_plot.show()
# tw.plt_loop()
img_plot.save(r'c:\temp\fig1.png')
Example #13
0
import tensorwatch as tw

from regim import *
ds = DataUtils.mnist_datasets(linearize=True, train_test=False)
ds = DataUtils.sample_by_class(ds, k=5, shuffle=True, as_np=True, no_test=True)

comps = tw.get_tsne_components(ds)
print(comps)
plot = tw.Visualizer(comps,
                     hover_images=ds[0],
                     hover_image_reshape=(28, 28),
                     vis_type='tsne')
plot.show()
Example #14
0
def show_text():
    cli = tw.WatcherClient()
    s1 = cli.create_stream(expr='lambda v:(v.i, v.sum)')
    text = tw.Visualizer(s1)
    text.show()
    input('Waiting')
Example #15
0
import tensorwatch as tw
import numpy as np
import time
import torchvision.datasets as datasets

fruits_ds = datasets.ImageFolder(r'D:\datasets\fruits-360\Training')
mnist_ds = datasets.MNIST('../data', train=True, download=True)

images = [tw.ImageData(fruits_ds[i][0], title=str(i)) for i in range(5)] + \
         [tw.ImageData(mnist_ds[i][0], title=str(i)) for i in range(5)]

stream = tw.ArrayStream(images)

img_plot = tw.Visualizer(stream, vis_type='image', viz_img_scale=3)
img_plot.show()

tw.image_utils.plt_loop()
Example #16
0
import tensorwatch as tw

w = tw.Watcher()
s = w.create_stream()

v = tw.Visualizer(s, vis_type='line')
v.show()

for i in range(10):
    i = float(i)
    s.write(tw.PointData(i, i * i, low=i * i - i, high=i * i + i))

tw.plt_loop()
Example #17
0
def show_text():
    cli = tw.WatcherClient(r'c:\temp\sum.log')
    s1 = cli.open_stream('sum_2')
    text = tw.Visualizer(s1)
    text.show()
    input('Waiting')
Example #18
0
def show_text():
    cli = tw.WatcherClient()
    text_vis = tw.Visualizer(st_isum, vis_type='text')
    text_vis.show()
    input('Waiting')
Example #19
0
def file_read():
    watcher = WatcherBase()
    stream = watcher.open_stream(devices=[r'c:\temp\obs.txt'])
    vis = tw.Visualizer(stream, vis_type='mpl-line')
    vis.show()
    plt_loop()