experiment.visdom module

class experiment.visdom.Line(name: str, window: experiment.visdom.Window, opts: dict = None)[source]

Bases: object

Class that encapsulates the creation and use of line plots.

Parameters:
  • name (str) – Name of line (used in the legend). The name is also important when plotting multiple lines on the same plot.
  • window (Window) – Window object to plot the line to.
  • opts (dict) – Optional visdom opts parameters to apply to the line.
append(x: float, y: float, opts: dict = None)[source]
class experiment.visdom.ParametersControlWindow(env, xlabel=None, ylabel=None, title=None, showlegend=False)[source]

Bases: experiment.visdom.Window

Visdom window for controlling parameters.

Parameters:env (string) – The visdom environment to log to.
register_parameters()[source]

Register parameters for controlling in the window.

Parameters:parameters (list) – List of Parameters to control.
class experiment.visdom.ParametersViewWindow(env, xlabel=None, ylabel=None, title=None, showlegend=False)[source]

Bases: experiment.visdom.Window

Visdom window for viewing parameters.

Parameters:
  • env (string) – The visdom environment to log to.
  • xlabel (string) – xlabel of plot.
  • ylabel (string) – ylabel of plot.
  • title (string) – Title of the plot.
  • showlegend (bool) – Whether to show a legend.
register_parameters()[source]

Register parameters for viewing in the window.

Parameters:parameters (list) – List of Parameter objects to view.
update(x: float)[source]

Update the values of the parameters on the view.

Parameters:x (float) – x value of graph.
class experiment.visdom.VisdomLogHandler(env, title='Logging', *args, **kwds)[source]

Bases: logging.Handler

Logging handler that logs to a Visdom text window.

Parameters:
  • env (string) – The visdom environment to log to.
  • title (string) – Title of the logger window
emit(record)[source]

Do whatever it takes to actually log the specified logging record.

This version is intended to be implemented by subclasses and so raises a NotImplementedError.

class experiment.visdom.Window(env, xlabel=None, ylabel=None, title=None, showlegend=False)[source]

Bases: object

Class for creating visdom windows.

Parameters:
  • env (string) – The visdom environment to log to.
  • xlabel (string) – xlabel of plot.
  • ylabel (string) – ylabel of plot.
  • title (string) – Title of the plot.
  • showlegend (bool) – Whether to show a legend.
env
opts
update_mode
win
experiment.visdom.create_parameters_windows()[source]

Create control and view windows for parameters

Parameters:
  • env (string) – The visdom environment to log to.
  • xlabel (string) – xlabel of plot.
  • ylabel (string) – ylabel of plot.
  • title (string) – Title of the plot.
  • showlegend (bool) – Whether to show a legend.
experiment.visdom.create_plot_window(vis, env, xlabel, ylabel, title, legend=None)[source]

Create a plot window.

Parameters:
  • vis (object) – The Visdom object.
  • env (string) – The visdom environment to log to.
  • xlabel (string) – xlabel of plot.
  • ylabel (string) – ylabel of plot.
  • title (string) – Title of the plot.
  • legend (string) – Legend of line.

Note

Depracated. Use the new Window interface.

experiment.visdom.monitor_gpu(env: str, gpu_index: int = None, xtick_size: int = 100) → threading.Thread[source]

Monitor the memory and utilization of a GPU.

Parameters:
  • env (str) – The visdom environment to log to.
  • gpu_index (int) – The GPU to monitor.
experiment.visdom.setup_visdom(server: str = '', log_to_filename: str = None, save_by_default: bool = True) → visdom.Visdom[source]

Setup the communication with the visdom server.

Parameters:
  • server (str) – IP of visdom server.
  • log_to_filename (str) – If not None, a log of the plots will be saved to this path. This log can be later replayed into visdom.
  • save_by_default (bool) – Automatically save the environment each update (Saved under ‘~/.visdom/<ENV>’
experiment.visdom.write_conf(env, args=None, text=None)[source]

Write configuration to the Visdom env.

Parameters:
  • env (string) – The visdom environment to log to.
  • args (Namespace, optional) – The argument namespace returned by argparse.
  • text (string, optional) – Configuration as text block.