twodlearn.monitoring module

class twodlearn.monitoring.GradientL2Monitor(*x_tf, **kwargs)[source]

Bases: twodlearn.monitoring.TrainingMonitor

monitors the L2 norm of the gradient w.r.t x_tf

setup_op()[source]
class twodlearn.monitoring.ImageMonitor(*x_tf, **kwargs)[source]

Bases: twodlearn.monitoring.TrainingMonitor

Monitors provided image data

static mplfig2tf(fig)[source]

converts a matplotlib figure to a tensorflow tensor

mplfig2tfsummary(fig)[source]
setup_op()[source]

setup tf operation to be run, the output of this operation is the one saved by the monitor. The operation in this case is a tf summary

tf_summary_data()[source]

writes last feed value into a file to be read by tensorboard

class twodlearn.monitoring.MonitorManager(log_folder='tmp/', tf_graph=None, use_tensorboard=True)[source]

Bases: object

property active_monitors[source]

Returns only active monitors

add_monitor(monitor)[source]
close()[source]
feed(data_in, step)[source]
flush()[source]
get_stats()[source]

get statistics from loggers @retval dictionary with the statistics of each logger

property monitors[source]

Returns all monitors

property monitors_data[source]

get data_buffer from the monitors @retval data_buffer from the list of monitors as a pandas dataframe

reopen()[source]
property tf_monitors[source]

Returns only active and valid monitors that have a tf op associated

property tf_summary[source]
write_data(step=None)[source]

Writes last value feed into the monitor for being read by tensorboard

write_stats(step=None)[source]
class twodlearn.monitoring.MonitoringData(folder)[source]

Bases: object

Class for loading tfevent files

read_tf_scalar_summary()[source]

Returns the tfevent summary in file_path as a pandas dataframe

search_monitor_data(search_path)[source]

search for tfevents inside search_path recursively

class twodlearn.monitoring.MonitoringDataV2(folder)[source]

Bases: object

Class for loading tfevent files

static read_tf_scalar_summary(file_path)[source]

Returns the tfevent summary in file_path as a pandas dataframe

search_monitor_data(search_path)[source]

search for tfevents inside search_path recursively

class twodlearn.monitoring.OpMonitor(*x_tf, **kwargs)[source]

Bases: twodlearn.monitoring.TrainingMonitor

monitors the result of the given operation

setup_op()[source]
class twodlearn.monitoring.PerformanceSaver(filename, tmp_path=None)[source]

Bases: object

clear()[source]
log(log_dict)[source]
save(log_dict=None)[source]
class twodlearn.monitoring.ResetGradientL2Monitor(x, clip_norm, **kwargs)[source]

Bases: twodlearn.monitoring.TrainingMonitor

monitors the gradients dl_dx. Gradients are set to zero if their norm is larger than clip_norm

setup_op()[source]
class twodlearn.monitoring.ScalarMonitor(x_tf=None, name=None, **kargs)[source]

Bases: twodlearn.monitoring.TrainingMonitor

class twodlearn.monitoring.SimpleTrainingMonitor(train_vars, valid_vars=None, monitoring_vars=None, log_folder='tmp/monitors/', tf_graph=None)[source]

Bases: twodlearn.monitoring.TrainingMonitorManager

class twodlearn.monitoring.TrainingMonitor(*x_tf, **kwargs)[source]

Bases: object

This class creates operations that logs information about the tensor x_tf during training

property current_step[source]
property current_value[source]
property data[source]

Creates a dataframe with the data in the buffer @retval data_buffer as a dataframe

feed(data, step=None)[source]

feed data to the monitor @param data: data added into the buffer

get_stats()[source]

get statistics @retval dictionary with the statistics of the monitor

property max[source]
mean(window_size=None)[source]

Returns the mean for the last window_size elements @param n_elements

property mean_data[source]

Creates a dataframe with the data in mean_buffer @retval mean_buffer as a dataframe

property mean_max[source]
property mean_min[source]
property min[source]
setup_op()[source]
tf_summary_data()[source]
property tf_summary_op[source]
tf_summary_stats()[source]
class twodlearn.monitoring.TrainingMonitorManager(log_folder='tmp/monitors/', tf_graph=None)[source]

Bases: object

close()[source]
flush()[source]
get_stats()[source]
reopen()[source]