Channels

A channel is a simple stream of values or metric. Per default hose values will be organised by x and are displayed as a interactive graph.
You can create channels to send custom metrics. A channel is a two-dimensional data stream with x=iteration and y=one or more traces.

Allowed types
  1. Number (default)
  2. Text

You can completely configure the graph for type=Number using traces, xaxis, yaxis and layout accordingly to the specification at plot.ly/javascript/reference. See also the API documentation of aetros.backend.JobChannel and aetros.backend.JobBackend:create_channel.

How to use

Please see the Job API introduction and the exact API of create-channel (which is the __init__ of JobChannel).
print('{aetros: create-channel, name: accuracy, kpi: true}') print('{aetros: create-channel, name: loss, traces: [validation, training]}') for i in range(1, 100): time.sleep(1) print('{aetros: channel, name: accuracy, x: %d, y: %d}' % (i+1, i*2)) for batch in range(1, 32): time.sleep(0.1) print('{aetros: channel, name: loss, x: %d, y: [%d, %d]}' % (i+1, i*2, i/2))
setbuf(stream, NULL); //important to disable output buffering printf('{aetros: create-channel, name: accuracy, kpi: true}\n'); printf('{aetros: create-channel, name: loss, traces: [validation, training]}\n'); for (int i = 0; i < 100; i++) { printf('{aetros: epoch, epoch: %d, total: 100}\n', i+1); }
System.out.print('{aetros: create-channel, name: accuracy, kpi: true}\n'); System.out.print('{aetros: create-channel, name: loss, traces: [validation, training]}\n'); for (int i = 0; i < 100; i++) { System.out.format('{aetros: epoch, epoch: %d, total: 100}', i+1); }
print('{aetros: create-channel, name: accuracy, kpi: true}\n'); print('{aetros: create-channel, name: loss, traces: [validation, training]}\n'); for (i in 1:100){ sprintf('{aetros: epoch, epoch: %d, total: 100}', i); }
echo "{aetros: create-channel, name: accuracy, kpi: true}" echo "{aetros: create-channel, name: loss, traces: [validation, training]}" for i in `seq 1 100`; echo "{aetros: epoch, epoch: $i, total: 100}"
import aetros.backend job = aetros.backend.context() accuracy = job.create_channel('accuracy', kpi=True) loss = job.create_channel('loss') for i in range(1, 100): accuracy.send(x, i) for batch in range(1, 32): time.sleep(0.1) loss.send(x, [i*2, i/2])

Examples

Example number

import aetros.backend job = aetros.backend.context() accuracy_channel = job.create_channel('accuracy', yaxis={'dtick': 10}) accuracy_channel.send(x=1, y=14.223) accuracy_channel.send(x=2, y=15.44) accuracy_channel.send(x=3, y=20.123) accuracy_channel.send(x=4, y=24.123) accuracy_channel.send(x=5, y=29.543) accuracy_channel.send(x=6, y=31.166) accuracy_channel.send(x=7, y=35.166)

Example number loop

import aetros.backend import math job = aetros.backend.context() sinus_channel = job.create_channel('sinus') for i in range(1, 100): sinus_channel.send(x=i, y=math.sin(i/4.0))

Example number bar

import aetros.backend import math job = aetros.backend.context() traces = [ { 'name': 'sinus', 'type': 'bar' } ] sinus_channel = job.create_channel('+sinus', traces=traces) for i in range(1, 100): sinus_channel.send(x=i, y=math.fabs(math.sin(i/4.0)))

Multiple traces

import aetros.backend import math job = aetros.backend.context() sinus_channel = job.create_channel('sinus', traces=['sin', 'cos']) for i in range(1, 100): sinus_channel.send(x=i, y=[math.sin(i/4.0), math.cos(i/4.0)])

Multiple traces grouped

import aetros.backend import math job = aetros.backend.context() traces = [ { 'name': 'a', 'type': 'bar' }, { 'name': 'b', 'type': 'bar' } ] layout = {'barmode': 'group'} grouped = job.create_channel('grouped', traces=traces, layout=layout) for i in range(1, 10): a = math.sin(i/10.0)*math.cos(i/10.0)*math.log(i/10.0)+1 b = math.sin(i/9.0)*math.cos(i/9.0)*math.log(i/14.0)+1 grouped.send(x=i, y=[a, b])

Example loss channel

import aetros.backend from aetros.backend import JobChannel import math job = aetros.backend.context() loss_channel = job.create_loss_channel('loss') for i in range(1, 100): a = math.sin(i/10.0)*math.cos(i/10.0)*math.log(i/10.0)+1 b = math.sin(i/9.0)*math.cos(i/9.0)*math.log(i/14.0)+1 loss_channel.send(i, a, b)

Example text

import aetros.backend from aetros.backend import JobChannel import math job = aetros.backend.context() log_channel = job.create_channel('log', type=JobChannel.TEXT) for i in range(1, 100): log_channel.send(x=i, y=str(math.sin(i/4.0)))