Documentation Python SDK Channels

Channels

You can create channels per job to send custom metrics to AETROS Trainer. A channel is a two-dimensional data stream with x=iteration and y=one or more traces.

Allowed types
  1. Number (default)
  2. Text
  3. Image

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

Examples

Example number

import aetros.backend job = aetros.backend.start_job('username/model') 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.start_job('username/model') 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.start_job('username/model') 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.start_job('username/model') 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.start_job('username/model') 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.start_job('username/model') 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.start_job('username/model') 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)))