flambe.logging.datatypes

Module Contents

class flambe.logging.datatypes.ScalarT[source]

Bases: typing.NamedTuple

A single scalar value

Supported by TensorboardX

Parameters:
  • tag (str) – Data identifier
  • scalar_value (float) – The scalar value
  • global_step (int) – Iteration associated with this value
  • walltime (float = time.time()) – Wall clock time associated with this value
tag :str[source]
scalar_value :float[source]
global_step :int[source]
walltime :float[source]
__repr__(self)[source]
class flambe.logging.datatypes.ScalarsT[source]

Bases: typing.NamedTuple

A dictionary mapping tag keys to scalar values

Supported by TensorboardX

Parameters:
  • main_tag (str) – Parent name for all the children tags
  • tag_scalar_dict (Dict[str, float]) – Mapping from scalar tags to their values
  • global_step (int) – Iteration associated with this value
  • walltime (float = time.time()) – Wall clock time associated with this value
main_tag :str[source]
tag_scalar_dict :Dict[str, float][source]
global_step :int[source]
walltime :float[source]
__repr__(self)[source]
class flambe.logging.datatypes.HistogramT[source]

Bases: typing.NamedTuple

A histogram with an array of values

Supported by TensorboardX

Parameters:
  • tag (str) – Data identifier
  • values (Union[torch.Tensor, numpy.array]) – Values to build histogram
  • global_step (int) – Iteration associated with this value
  • bins (str) – Determines how bins are made
  • walltime (float = time.time()) – Wall clock time associated with this value
tag :str[source]
values :Union[torch.Tensor, numpy.array][source]
global_step :int[source]
bins :str[source]
walltime :float[source]
__repr__(self)[source]
class flambe.logging.datatypes.ImageT[source]

Bases: typing.NamedTuple

Image message

Supported by TensorboardX

Parameters:
  • tag (str) – Data identifier
  • img_tensor (Union) – Image tensor to record
  • global_step (int) – Iteration associated with this value
  • walltime (float) – Wall clock time associated with this value
tag :str[source]
img_tensor :Union[torch.Tensor, numpy.array][source]
global_step :int[source]
walltime :float[source]
__repr__(self)[source]
class flambe.logging.datatypes.TextT[source]

Bases: typing.NamedTuple

Text message

Supported by TensorboardX

Parameters:
  • tag (str) – Data identifier
  • text_string (str) – String to record
  • global_step (int) – Iteration associated with this value
  • walltime (float) – Wall clock time associated with this value
tag :str[source]
text_string :str[source]
global_step :int[source]
walltime :float[source]
__repr__(self)[source]
class flambe.logging.datatypes.PRCurveT[source]

Bases: typing.NamedTuple

PRCurve message

Supported by TensorboardX

Parameters:
  • tag (str) – Data identifier
  • labels (Union[torch.Tensor, numpy.array]) – Containing 0, 1 values
  • predictions (Union[torch.Tensor, numpy.array]) – Containing 0<=x<=1 values. Needs to match labels size
  • num_thresholds (int = 127) – The number of thresholds to evaluate. Max value allowed 127.
  • weights (Optional[float] = None) – No description provided.
  • global_step (int) – Iteration associated with this value
  • walltime (float) – Wall clock time associated with this value
tag :str[source]
labels :Union[torch.Tensor, numpy.array][source]
predictions :Union[torch.Tensor, numpy.array][source]
global_step :int[source]
num_thresholds :int = 127[source]
weights :Optional[float][source]
walltime :float[source]
__repr__(self)[source]
class flambe.logging.datatypes.EmbeddingT[source]

Bases: typing.NamedTuple

Embedding data, including array of vaues and metadata

Supported by TensorboardX

Parameters:
  • mat (\((N, D)\)) – A matrix where each row is the feature vector of a data point
  • metadata (Sequence[str]) – A list of labels; each element will be converted to string
  • label_img (\((N, C, H, W)\)) – Images corresponding to each data point
  • global_step (int) – Iteration associated with this value
  • tag (str) – Data identifier
  • metadata_header (Sequence[str]) –
  • Shape
  • -----
  • mat – where N is number of data and D is feature dimension
  • label_img
mat :Union[torch.Tensor, numpy.array][source]
metadata :Sequence[str][source]
label_img :torch.Tensor[source]
global_step :int[source]
tag :str[source]
metadata_header :Sequence[str][source]
__repr__(self)[source]
class flambe.logging.datatypes.GraphT[source]

Bases: typing.NamedTuple

PyTorch Model with input and other keyword args

Supported by ModelSave NOT YET Supported by TensorboardX

model[source]

PyTorch Model (should have forward and state_dict methods)

Type:torch.nn.Module
input_to_model[source]

Input to the model forward call

Type:torch.autograd.Variable
verbose[source]

Include extra detail

Type:bool = False
kwargs[source]

Other kwargs for model recording

Type:Dict[str, Any] = {}
model :torch.nn.Module[source]
input_to_model :torch.autograd.Variable[source]
verbose :bool = False[source]
kwargs :Dict[str, Any][source]
flambe.logging.datatypes.DATA_TYPES[source]
class flambe.logging.datatypes.DataLoggingFilter(default: bool = True, level: int = logging.NOTSET, dont_include: Optional[Tuple[type, ...]] = None, **kwargs: Any)[source]

Bases: logging.Filter

Filters on DATA_TYPES otherwise returns default

filter returns self.default if record is not a DATA_TYPES type; True if message is a DATA_TYPES type not in dont_include and high enough level; otherwise False

Parameters:
  • default (bool) – Returned when record is not one DATA_TYPES
  • level (int) – Minimum level of records that are DATA_TYPES to be accepted
  • dont_include (Sequence[Type[Any]]) – Types from DATA_TYPES to be excluded
  • **kwargs (Any) – Additional kwargs to pass to logging.Filter
default

Returned when record is not one DATA_TYPES

Type:bool
level

Minimum level of records that are DATA_TYPES to be accepted

Type:int
dont_include

Types from DATA_TYPES to be excluded

Type:Tuple[Type[Any]]
filter(self, record: logging.LogRecord)[source]

Return True iff record should be accepted

Parameters:record (logging.LogRecord) – logging record to be filtered
Returns:True iff record should be accepted. self.default if record is not a DATA_TYPES type; True if message is a DATA_TYPES type not in dont_include and high enough level; otherwise False
Return type:bool