repo
stringlengths
7
54
path
stringlengths
4
223
func_name
stringlengths
1
134
original_string
stringlengths
75
104k
language
stringclasses
1 value
code
stringlengths
75
104k
code_tokens
listlengths
20
28.4k
docstring
stringlengths
1
46.3k
docstring_tokens
listlengths
1
1.66k
sha
stringlengths
40
40
url
stringlengths
87
315
partition
stringclasses
1 value
summary
stringlengths
4
350
obf_code
stringlengths
7.85k
764k
tensorflow/tensorboard
tensorboard/plugins/interactive_inference/utils/common_utils.py
convert_predict_response
def convert_predict_response(pred, serving_bundle): """Converts a PredictResponse to ClassificationResponse or RegressionResponse. Args: pred: PredictResponse to convert. serving_bundle: A `ServingBundle` object that contains the information about the serving request that the response was generated b...
python
def convert_predict_response(pred, serving_bundle): """Converts a PredictResponse to ClassificationResponse or RegressionResponse. Args: pred: PredictResponse to convert. serving_bundle: A `ServingBundle` object that contains the information about the serving request that the response was generated b...
[ "def", "convert_predict_response", "(", "pred", ",", "serving_bundle", ")", ":", "output", "=", "pred", ".", "outputs", "[", "serving_bundle", ".", "predict_output_tensor", "]", "raw_output", "=", "output", ".", "float_val", "if", "serving_bundle", ".", "model_typ...
Converts a PredictResponse to ClassificationResponse or RegressionResponse. Args: pred: PredictResponse to convert. serving_bundle: A `ServingBundle` object that contains the information about the serving request that the response was generated by. Returns: A ClassificationResponse or Regression...
[ "Converts", "a", "PredictResponse", "to", "ClassificationResponse", "or", "RegressionResponse", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/interactive_inference/utils/common_utils.py#L39-L59
train
Converts a PredictResponse to ClassificationResponse or RegressionResponse.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/interactive_inference/utils/common_utils.py
convert_prediction_values
def convert_prediction_values(values, serving_bundle, model_spec=None): """Converts tensor values into ClassificationResponse or RegressionResponse. Args: values: For classification, a 2D list of numbers. The first dimension is for each example being predicted. The second dimension are the probabilities ...
python
def convert_prediction_values(values, serving_bundle, model_spec=None): """Converts tensor values into ClassificationResponse or RegressionResponse. Args: values: For classification, a 2D list of numbers. The first dimension is for each example being predicted. The second dimension are the probabilities ...
[ "def", "convert_prediction_values", "(", "values", ",", "serving_bundle", ",", "model_spec", "=", "None", ")", ":", "if", "serving_bundle", ".", "model_type", "==", "'classification'", ":", "response", "=", "classification_pb2", ".", "ClassificationResponse", "(", "...
Converts tensor values into ClassificationResponse or RegressionResponse. Args: values: For classification, a 2D list of numbers. The first dimension is for each example being predicted. The second dimension are the probabilities for each class ID in the prediction. For regression, a 1D list of numbe...
[ "Converts", "tensor", "values", "into", "ClassificationResponse", "or", "RegressionResponse", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/interactive_inference/utils/common_utils.py#L61-L91
train
Converts tensor values into ClassificationResponse or RegressionResponse.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/backend/event_processing/plugin_event_accumulator.py
_GetPurgeMessage
def _GetPurgeMessage(most_recent_step, most_recent_wall_time, event_step, event_wall_time, num_expired): """Return the string message associated with TensorBoard purges.""" return ('Detected out of order event.step likely caused by a TensorFlow ' 'restart. Purging {} expired tensor ev...
python
def _GetPurgeMessage(most_recent_step, most_recent_wall_time, event_step, event_wall_time, num_expired): """Return the string message associated with TensorBoard purges.""" return ('Detected out of order event.step likely caused by a TensorFlow ' 'restart. Purging {} expired tensor ev...
[ "def", "_GetPurgeMessage", "(", "most_recent_step", ",", "most_recent_wall_time", ",", "event_step", ",", "event_wall_time", ",", "num_expired", ")", ":", "return", "(", "'Detected out of order event.step likely caused by a TensorFlow '", "'restart. Purging {} expired tensor events...
Return the string message associated with TensorBoard purges.
[ "Return", "the", "string", "message", "associated", "with", "TensorBoard", "purges", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/event_processing/plugin_event_accumulator.py#L560-L568
train
Return the string message associated with TensorBoard purges.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/backend/event_processing/plugin_event_accumulator.py
EventAccumulator.PluginTagToContent
def PluginTagToContent(self, plugin_name): """Returns a dict mapping tags to content specific to that plugin. Args: plugin_name: The name of the plugin for which to fetch plugin-specific content. Raises: KeyError: if the plugin name is not found. Returns: A dict mapping tags...
python
def PluginTagToContent(self, plugin_name): """Returns a dict mapping tags to content specific to that plugin. Args: plugin_name: The name of the plugin for which to fetch plugin-specific content. Raises: KeyError: if the plugin name is not found. Returns: A dict mapping tags...
[ "def", "PluginTagToContent", "(", "self", ",", "plugin_name", ")", ":", "if", "plugin_name", "not", "in", "self", ".", "_plugin_to_tag_to_content", ":", "raise", "KeyError", "(", "'Plugin %r could not be found.'", "%", "plugin_name", ")", "with", "self", ".", "_pl...
Returns a dict mapping tags to content specific to that plugin. Args: plugin_name: The name of the plugin for which to fetch plugin-specific content. Raises: KeyError: if the plugin name is not found. Returns: A dict mapping tags to plugin-specific content (which are always stri...
[ "Returns", "a", "dict", "mapping", "tags", "to", "content", "specific", "to", "that", "plugin", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/event_processing/plugin_event_accumulator.py#L234-L252
train
Returns a dict mapping tags to content specific to a plugin.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/backend/event_processing/plugin_event_accumulator.py
EventAccumulator._ProcessEvent
def _ProcessEvent(self, event): """Called whenever an event is loaded.""" if self._first_event_timestamp is None: self._first_event_timestamp = event.wall_time if event.HasField('file_version'): new_file_version = _ParseFileVersion(event.file_version) if self.file_version and self.file_ve...
python
def _ProcessEvent(self, event): """Called whenever an event is loaded.""" if self._first_event_timestamp is None: self._first_event_timestamp = event.wall_time if event.HasField('file_version'): new_file_version = _ParseFileVersion(event.file_version) if self.file_version and self.file_ve...
[ "def", "_ProcessEvent", "(", "self", ",", "event", ")", ":", "if", "self", ".", "_first_event_timestamp", "is", "None", ":", "self", ".", "_first_event_timestamp", "=", "event", ".", "wall_time", "if", "event", ".", "HasField", "(", "'file_version'", ")", ":...
Called whenever an event is loaded.
[ "Called", "whenever", "an", "event", "is", "loaded", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/event_processing/plugin_event_accumulator.py#L268-L356
train
Processes an event.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/backend/event_processing/plugin_event_accumulator.py
EventAccumulator.Tags
def Tags(self): """Return all tags found in the value stream. Returns: A `{tagType: ['list', 'of', 'tags']}` dictionary. """ return { TENSORS: list(self.tensors_by_tag.keys()), # Use a heuristic: if the metagraph is available, but # graph is not, then we assume the metagra...
python
def Tags(self): """Return all tags found in the value stream. Returns: A `{tagType: ['list', 'of', 'tags']}` dictionary. """ return { TENSORS: list(self.tensors_by_tag.keys()), # Use a heuristic: if the metagraph is available, but # graph is not, then we assume the metagra...
[ "def", "Tags", "(", "self", ")", ":", "return", "{", "TENSORS", ":", "list", "(", "self", ".", "tensors_by_tag", ".", "keys", "(", ")", ")", ",", "# Use a heuristic: if the metagraph is available, but", "# graph is not, then we assume the metagraph contains the graph.", ...
Return all tags found in the value stream. Returns: A `{tagType: ['list', 'of', 'tags']}` dictionary.
[ "Return", "all", "tags", "found", "in", "the", "value", "stream", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/event_processing/plugin_event_accumulator.py#L358-L371
train
Return all tags found in the value stream.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/backend/event_processing/plugin_event_accumulator.py
EventAccumulator._MaybePurgeOrphanedData
def _MaybePurgeOrphanedData(self, event): """Maybe purge orphaned data due to a TensorFlow crash. When TensorFlow crashes at step T+O and restarts at step T, any events written after step T are now "orphaned" and will be at best misleading if they are included in TensorBoard. This logic attempts t...
python
def _MaybePurgeOrphanedData(self, event): """Maybe purge orphaned data due to a TensorFlow crash. When TensorFlow crashes at step T+O and restarts at step T, any events written after step T are now "orphaned" and will be at best misleading if they are included in TensorBoard. This logic attempts t...
[ "def", "_MaybePurgeOrphanedData", "(", "self", ",", "event", ")", ":", "if", "not", "self", ".", "purge_orphaned_data", ":", "return", "## Check if the event happened after a crash, and purge expired tags.", "if", "self", ".", "file_version", "and", "self", ".", "file_v...
Maybe purge orphaned data due to a TensorFlow crash. When TensorFlow crashes at step T+O and restarts at step T, any events written after step T are now "orphaned" and will be at best misleading if they are included in TensorBoard. This logic attempts to determine if there is orphaned data, and purge ...
[ "Maybe", "purge", "orphaned", "data", "due", "to", "a", "TensorFlow", "crash", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/event_processing/plugin_event_accumulator.py#L439-L466
train
Maybe purge orphaned data due to a TensorFlow crash.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/backend/event_processing/plugin_event_accumulator.py
EventAccumulator._CheckForOutOfOrderStepAndMaybePurge
def _CheckForOutOfOrderStepAndMaybePurge(self, event): """Check for out-of-order event.step and discard expired events for tags. Check if the event is out of order relative to the global most recent step. If it is, purge outdated summaries for tags that the event contains. Args: event: The event...
python
def _CheckForOutOfOrderStepAndMaybePurge(self, event): """Check for out-of-order event.step and discard expired events for tags. Check if the event is out of order relative to the global most recent step. If it is, purge outdated summaries for tags that the event contains. Args: event: The event...
[ "def", "_CheckForOutOfOrderStepAndMaybePurge", "(", "self", ",", "event", ")", ":", "if", "event", ".", "step", "<", "self", ".", "most_recent_step", "and", "event", ".", "HasField", "(", "'summary'", ")", ":", "self", ".", "_Purge", "(", "event", ",", "by...
Check for out-of-order event.step and discard expired events for tags. Check if the event is out of order relative to the global most recent step. If it is, purge outdated summaries for tags that the event contains. Args: event: The event to use as reference. If the event is out-of-order, all ...
[ "Check", "for", "out", "-", "of", "-", "order", "event", ".", "step", "and", "discard", "expired", "events", "for", "tags", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/event_processing/plugin_event_accumulator.py#L488-L499
train
Checks if the event is out - of - order and discards expired events for tags.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/backend/event_processing/plugin_event_accumulator.py
EventAccumulator._Purge
def _Purge(self, event, by_tags): """Purge all events that have occurred after the given event.step. If by_tags is True, purge all events that occurred after the given event.step, but only for the tags that the event has. Non-sequential event.steps suggest that a TensorFlow restart occurred, and we dis...
python
def _Purge(self, event, by_tags): """Purge all events that have occurred after the given event.step. If by_tags is True, purge all events that occurred after the given event.step, but only for the tags that the event has. Non-sequential event.steps suggest that a TensorFlow restart occurred, and we dis...
[ "def", "_Purge", "(", "self", ",", "event", ",", "by_tags", ")", ":", "## Keep data in reservoirs that has a step less than event.step", "_NotExpired", "=", "lambda", "x", ":", "x", ".", "step", "<", "event", ".", "step", "num_expired", "=", "0", "if", "by_tags"...
Purge all events that have occurred after the given event.step. If by_tags is True, purge all events that occurred after the given event.step, but only for the tags that the event has. Non-sequential event.steps suggest that a TensorFlow restart occurred, and we discard the out-of-order events to displ...
[ "Purge", "all", "events", "that", "have", "occurred", "after", "the", "given", "event", ".", "step", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/event_processing/plugin_event_accumulator.py#L517-L557
train
Purge all events that have occurred after the given event. step.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/beholder/beholder_plugin_loader.py
BeholderPluginLoader.load
def load(self, context): """Returns the plugin, if possible. Args: context: The TBContext flags. Returns: A BeholderPlugin instance or None if it couldn't be loaded. """ try: # pylint: disable=g-import-not-at-top,unused-import import tensorflow except ImportError: ...
python
def load(self, context): """Returns the plugin, if possible. Args: context: The TBContext flags. Returns: A BeholderPlugin instance or None if it couldn't be loaded. """ try: # pylint: disable=g-import-not-at-top,unused-import import tensorflow except ImportError: ...
[ "def", "load", "(", "self", ",", "context", ")", ":", "try", ":", "# pylint: disable=g-import-not-at-top,unused-import", "import", "tensorflow", "except", "ImportError", ":", "return", "# pylint: disable=g-import-not-at-top", "from", "tensorboard", ".", "plugins", ".", ...
Returns the plugin, if possible. Args: context: The TBContext flags. Returns: A BeholderPlugin instance or None if it couldn't be loaded.
[ "Returns", "the", "plugin", "if", "possible", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/beholder/beholder_plugin_loader.py#L30-L46
train
Returns the plugin if possible.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/graph/keras_util.py
_walk_layers
def _walk_layers(keras_layer): """Walks the nested keras layer configuration in preorder. Args: keras_layer: Keras configuration from model.to_json. Yields: A tuple of (name_scope, layer_config). name_scope: a string representing a scope name, similar to that of tf.name_scope. layer_config: a dic...
python
def _walk_layers(keras_layer): """Walks the nested keras layer configuration in preorder. Args: keras_layer: Keras configuration from model.to_json. Yields: A tuple of (name_scope, layer_config). name_scope: a string representing a scope name, similar to that of tf.name_scope. layer_config: a dic...
[ "def", "_walk_layers", "(", "keras_layer", ")", ":", "yield", "(", "''", ",", "keras_layer", ")", "if", "keras_layer", ".", "get", "(", "'config'", ")", ".", "get", "(", "'layers'", ")", ":", "name_scope", "=", "keras_layer", ".", "get", "(", "'config'",...
Walks the nested keras layer configuration in preorder. Args: keras_layer: Keras configuration from model.to_json. Yields: A tuple of (name_scope, layer_config). name_scope: a string representing a scope name, similar to that of tf.name_scope. layer_config: a dict representing a Keras layer configu...
[ "Walks", "the", "nested", "keras", "layer", "configuration", "in", "preorder", ".", "Args", ":", "keras_layer", ":", "Keras", "configuration", "from", "model", ".", "to_json", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/graph/keras_util.py#L48-L65
train
Walks the nested keras layer configuration in preorder.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/graph/keras_util.py
_update_dicts
def _update_dicts(name_scope, model_layer, input_to_in_layer, model_name_to_output, prev_node_name): """Updates input_to_in_layer, model_name_to_output, and prev_node_name based on the model_layer. Args: name_scope: a string representing...
python
def _update_dicts(name_scope, model_layer, input_to_in_layer, model_name_to_output, prev_node_name): """Updates input_to_in_layer, model_name_to_output, and prev_node_name based on the model_layer. Args: name_scope: a string representing...
[ "def", "_update_dicts", "(", "name_scope", ",", "model_layer", ",", "input_to_in_layer", ",", "model_name_to_output", ",", "prev_node_name", ")", ":", "layer_config", "=", "model_layer", ".", "get", "(", "'config'", ")", "if", "not", "layer_config", ".", "get", ...
Updates input_to_in_layer, model_name_to_output, and prev_node_name based on the model_layer. Args: name_scope: a string representing a scope name, similar to that of tf.name_scope. model_layer: a dict representing a Keras model configuration. input_to_in_layer: a dict mapping Keras.layers.Input to inb...
[ "Updates", "input_to_in_layer", "model_name_to_output", "and", "prev_node_name", "based", "on", "the", "model_layer", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/graph/keras_util.py#L114-L177
train
Updates input_to_in_layer model_name_to_output and prev_node_name_to_output based on the model_layer.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/graph/keras_util.py
keras_model_to_graph_def
def keras_model_to_graph_def(keras_layer): """Returns a GraphDef representation of the Keras model in a dict form. Note that it only supports models that implemented to_json(). Args: keras_layer: A dict from Keras model.to_json(). Returns: A GraphDef representation of the layers in the model. """ ...
python
def keras_model_to_graph_def(keras_layer): """Returns a GraphDef representation of the Keras model in a dict form. Note that it only supports models that implemented to_json(). Args: keras_layer: A dict from Keras model.to_json(). Returns: A GraphDef representation of the layers in the model. """ ...
[ "def", "keras_model_to_graph_def", "(", "keras_layer", ")", ":", "input_to_layer", "=", "{", "}", "model_name_to_output", "=", "{", "}", "g", "=", "GraphDef", "(", ")", "# Sequential model layers do not have a field \"inbound_nodes\" but", "# instead are defined implicitly vi...
Returns a GraphDef representation of the Keras model in a dict form. Note that it only supports models that implemented to_json(). Args: keras_layer: A dict from Keras model.to_json(). Returns: A GraphDef representation of the layers in the model.
[ "Returns", "a", "GraphDef", "representation", "of", "the", "Keras", "model", "in", "a", "dict", "form", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/graph/keras_util.py#L180-L239
train
Converts a Keras model to a GraphDef representation of the Keras model.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/hparams/hparams_plugin_loader.py
HParamsPluginLoader.load
def load(self, context): """Returns the plugin, if possible. Args: context: The TBContext flags. Returns: A HParamsPlugin instance or None if it couldn't be loaded. """ try: # pylint: disable=g-import-not-at-top,unused-import import tensorflow except ImportError: ...
python
def load(self, context): """Returns the plugin, if possible. Args: context: The TBContext flags. Returns: A HParamsPlugin instance or None if it couldn't be loaded. """ try: # pylint: disable=g-import-not-at-top,unused-import import tensorflow except ImportError: ...
[ "def", "load", "(", "self", ",", "context", ")", ":", "try", ":", "# pylint: disable=g-import-not-at-top,unused-import", "import", "tensorflow", "except", "ImportError", ":", "return", "# pylint: disable=g-import-not-at-top", "from", "tensorboard", ".", "plugins", ".", ...
Returns the plugin, if possible. Args: context: The TBContext flags. Returns: A HParamsPlugin instance or None if it couldn't be loaded.
[ "Returns", "the", "plugin", "if", "possible", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/hparams/hparams_plugin_loader.py#L30-L46
train
Returns the HParamsPlugin instance if possible.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugin_util.py
markdown_to_safe_html
def markdown_to_safe_html(markdown_string): """Convert Markdown to HTML that's safe to splice into the DOM. Arguments: markdown_string: A Unicode string or UTF-8--encoded bytestring containing Markdown source. Markdown tables are supported. Returns: A string containing safe HTML. """ warning =...
python
def markdown_to_safe_html(markdown_string): """Convert Markdown to HTML that's safe to splice into the DOM. Arguments: markdown_string: A Unicode string or UTF-8--encoded bytestring containing Markdown source. Markdown tables are supported. Returns: A string containing safe HTML. """ warning =...
[ "def", "markdown_to_safe_html", "(", "markdown_string", ")", ":", "warning", "=", "''", "# Convert to utf-8 whenever we have a binary input.", "if", "isinstance", "(", "markdown_string", ",", "six", ".", "binary_type", ")", ":", "markdown_string_decoded", "=", "markdown_s...
Convert Markdown to HTML that's safe to splice into the DOM. Arguments: markdown_string: A Unicode string or UTF-8--encoded bytestring containing Markdown source. Markdown tables are supported. Returns: A string containing safe HTML.
[ "Convert", "Markdown", "to", "HTML", "that", "s", "safe", "to", "splice", "into", "the", "DOM", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugin_util.py#L61-L87
train
Convert Markdown to HTML that s safe to splice into the DOM.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/compat/tensorflow_stub/dtypes.py
as_dtype
def as_dtype(type_value): """Converts the given `type_value` to a `DType`. Args: type_value: A value that can be converted to a `tf.DType` object. This may currently be a `tf.DType` object, a [`DataType` enum](https://www.tensorflow.org/code/tensorflow/core/framework/types.proto), ...
python
def as_dtype(type_value): """Converts the given `type_value` to a `DType`. Args: type_value: A value that can be converted to a `tf.DType` object. This may currently be a `tf.DType` object, a [`DataType` enum](https://www.tensorflow.org/code/tensorflow/core/framework/types.proto), ...
[ "def", "as_dtype", "(", "type_value", ")", ":", "if", "isinstance", "(", "type_value", ",", "DType", ")", ":", "return", "type_value", "try", ":", "return", "_INTERN_TABLE", "[", "type_value", "]", "except", "KeyError", ":", "pass", "try", ":", "return", "...
Converts the given `type_value` to a `DType`. Args: type_value: A value that can be converted to a `tf.DType` object. This may currently be a `tf.DType` object, a [`DataType` enum](https://www.tensorflow.org/code/tensorflow/core/framework/types.proto), a string type name, or a `numpy....
[ "Converts", "the", "given", "type_value", "to", "a", "DType", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/compat/tensorflow_stub/dtypes.py#L639-L690
train
Converts the given type_value to a TensorFlow DType object.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/compat/tensorflow_stub/dtypes.py
DType.real_dtype
def real_dtype(self): """Returns the dtype correspond to this dtype's real part.""" base = self.base_dtype if base == complex64: return float32 elif base == complex128: return float64 else: return self
python
def real_dtype(self): """Returns the dtype correspond to this dtype's real part.""" base = self.base_dtype if base == complex64: return float32 elif base == complex128: return float64 else: return self
[ "def", "real_dtype", "(", "self", ")", ":", "base", "=", "self", ".", "base_dtype", "if", "base", "==", "complex64", ":", "return", "float32", "elif", "base", "==", "complex128", ":", "return", "float64", "else", ":", "return", "self" ]
Returns the dtype correspond to this dtype's real part.
[ "Returns", "the", "dtype", "correspond", "to", "this", "dtype", "s", "real", "part", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/compat/tensorflow_stub/dtypes.py#L113-L121
train
Returns the dtype correspond to this dtype s real part.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/compat/tensorflow_stub/dtypes.py
DType.is_integer
def is_integer(self): """Returns whether this is a (non-quantized) integer type.""" return ( self.is_numpy_compatible and not self.is_quantized and np.issubdtype(self.as_numpy_dtype, np.integer) )
python
def is_integer(self): """Returns whether this is a (non-quantized) integer type.""" return ( self.is_numpy_compatible and not self.is_quantized and np.issubdtype(self.as_numpy_dtype, np.integer) )
[ "def", "is_integer", "(", "self", ")", ":", "return", "(", "self", ".", "is_numpy_compatible", "and", "not", "self", ".", "is_quantized", "and", "np", ".", "issubdtype", "(", "self", ".", "as_numpy_dtype", ",", "np", ".", "integer", ")", ")" ]
Returns whether this is a (non-quantized) integer type.
[ "Returns", "whether", "this", "is", "a", "(", "non", "-", "quantized", ")", "integer", "type", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/compat/tensorflow_stub/dtypes.py#L143-L149
train
Returns whether this is a non - quantized integer type.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/compat/tensorflow_stub/dtypes.py
DType.is_floating
def is_floating(self): """Returns whether this is a (non-quantized, real) floating point type.""" return ( self.is_numpy_compatible and np.issubdtype(self.as_numpy_dtype, np.floating) ) or self.base_dtype == bfloat16
python
def is_floating(self): """Returns whether this is a (non-quantized, real) floating point type.""" return ( self.is_numpy_compatible and np.issubdtype(self.as_numpy_dtype, np.floating) ) or self.base_dtype == bfloat16
[ "def", "is_floating", "(", "self", ")", ":", "return", "(", "self", ".", "is_numpy_compatible", "and", "np", ".", "issubdtype", "(", "self", ".", "as_numpy_dtype", ",", "np", ".", "floating", ")", ")", "or", "self", ".", "base_dtype", "==", "bfloat16" ]
Returns whether this is a (non-quantized, real) floating point type.
[ "Returns", "whether", "this", "is", "a", "(", "non", "-", "quantized", "real", ")", "floating", "point", "type", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/compat/tensorflow_stub/dtypes.py#L152-L156
train
Returns whether this is a non - quantized floating point type.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/compat/tensorflow_stub/dtypes.py
DType.min
def min(self): """Returns the minimum representable value in this data type. Raises: TypeError: if this is a non-numeric, unordered, or quantized type. """ if self.is_quantized or self.base_dtype in ( bool, string, complex64, co...
python
def min(self): """Returns the minimum representable value in this data type. Raises: TypeError: if this is a non-numeric, unordered, or quantized type. """ if self.is_quantized or self.base_dtype in ( bool, string, complex64, co...
[ "def", "min", "(", "self", ")", ":", "if", "self", ".", "is_quantized", "or", "self", ".", "base_dtype", "in", "(", "bool", ",", "string", ",", "complex64", ",", "complex128", ",", ")", ":", "raise", "TypeError", "(", "\"Cannot find minimum value of %s.\"", ...
Returns the minimum representable value in this data type. Raises: TypeError: if this is a non-numeric, unordered, or quantized type.
[ "Returns", "the", "minimum", "representable", "value", "in", "this", "data", "type", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/compat/tensorflow_stub/dtypes.py#L184-L209
train
Returns the minimum representable value in this data type.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/compat/tensorflow_stub/dtypes.py
DType.limits
def limits(self, clip_negative=True): """Return intensity limits, i.e. (min, max) tuple, of the dtype. Args: clip_negative : bool, optional If True, clip the negative range (i.e. return 0 for min intensity) even if the image dtype allows negative values. Ret...
python
def limits(self, clip_negative=True): """Return intensity limits, i.e. (min, max) tuple, of the dtype. Args: clip_negative : bool, optional If True, clip the negative range (i.e. return 0 for min intensity) even if the image dtype allows negative values. Ret...
[ "def", "limits", "(", "self", ",", "clip_negative", "=", "True", ")", ":", "min", ",", "max", "=", "dtype_range", "[", "self", ".", "as_numpy_dtype", "]", "# pylint: disable=redefined-builtin", "if", "clip_negative", ":", "min", "=", "0", "# pylint: disable=rede...
Return intensity limits, i.e. (min, max) tuple, of the dtype. Args: clip_negative : bool, optional If True, clip the negative range (i.e. return 0 for min intensity) even if the image dtype allows negative values. Returns min, max : tuple Lower...
[ "Return", "intensity", "limits", "i", ".", "e", ".", "(", "min", "max", ")", "tuple", "of", "the", "dtype", ".", "Args", ":", "clip_negative", ":", "bool", "optional", "If", "True", "clip", "the", "negative", "range", "(", "i", ".", "e", ".", "return...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/compat/tensorflow_stub/dtypes.py#L240-L253
train
Return intensity limits of the image dtype.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/compat/tensorflow_stub/dtypes.py
DType.is_compatible_with
def is_compatible_with(self, other): """Returns True if the `other` DType will be converted to this DType. The conversion rules are as follows: ```python DType(T) .is_compatible_with(DType(T)) == True DType(T) .is_compatible_with(DType(T).as_ref) == True ...
python
def is_compatible_with(self, other): """Returns True if the `other` DType will be converted to this DType. The conversion rules are as follows: ```python DType(T) .is_compatible_with(DType(T)) == True DType(T) .is_compatible_with(DType(T).as_ref) == True ...
[ "def", "is_compatible_with", "(", "self", ",", "other", ")", ":", "other", "=", "as_dtype", "(", "other", ")", "return", "self", ".", "_type_enum", "in", "(", "other", ".", "as_datatype_enum", ",", "other", ".", "base_dtype", ".", "as_datatype_enum", ",", ...
Returns True if the `other` DType will be converted to this DType. The conversion rules are as follows: ```python DType(T) .is_compatible_with(DType(T)) == True DType(T) .is_compatible_with(DType(T).as_ref) == True DType(T).as_ref.is_compatible_with(DType(T))...
[ "Returns", "True", "if", "the", "other", "DType", "will", "be", "converted", "to", "this", "DType", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/compat/tensorflow_stub/dtypes.py#L255-L278
train
Returns True if the other DType will be implicitly converted to this DType.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/debugger/interactive_debugger_plugin.py
InteractiveDebuggerPlugin.listen
def listen(self, grpc_port): """Start listening on the given gRPC port. This method of an instance of InteractiveDebuggerPlugin can be invoked at most once. This method is not thread safe. Args: grpc_port: port number to listen at. Raises: ValueError: If this instance is already liste...
python
def listen(self, grpc_port): """Start listening on the given gRPC port. This method of an instance of InteractiveDebuggerPlugin can be invoked at most once. This method is not thread safe. Args: grpc_port: port number to listen at. Raises: ValueError: If this instance is already liste...
[ "def", "listen", "(", "self", ",", "grpc_port", ")", ":", "if", "self", ".", "_grpc_port", ":", "raise", "ValueError", "(", "'This InteractiveDebuggerPlugin instance is already listening at '", "'gRPC port %d'", "%", "self", ".", "_grpc_port", ")", "self", ".", "_gr...
Start listening on the given gRPC port. This method of an instance of InteractiveDebuggerPlugin can be invoked at most once. This method is not thread safe. Args: grpc_port: port number to listen at. Raises: ValueError: If this instance is already listening at a gRPC port.
[ "Start", "listening", "on", "the", "given", "gRPC", "port", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/debugger/interactive_debugger_plugin.py#L80-L109
train
Starts listening on the given gRPC port.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/debugger/interactive_debugger_plugin.py
InteractiveDebuggerPlugin.get_plugin_apps
def get_plugin_apps(self): """Obtains a mapping between routes and handlers. This function also starts a debugger data server on separate thread if the plugin has not started one yet. Returns: A mapping between routes and handlers (functions that respond to requests). """ return { ...
python
def get_plugin_apps(self): """Obtains a mapping between routes and handlers. This function also starts a debugger data server on separate thread if the plugin has not started one yet. Returns: A mapping between routes and handlers (functions that respond to requests). """ return { ...
[ "def", "get_plugin_apps", "(", "self", ")", ":", "return", "{", "_ACK_ROUTE", ":", "self", ".", "_serve_ack", ",", "_COMM_ROUTE", ":", "self", ".", "_serve_comm", ",", "_DEBUGGER_GRPC_HOST_PORT_ROUTE", ":", "self", ".", "_serve_debugger_grpc_host_port", ",", "_DEB...
Obtains a mapping between routes and handlers. This function also starts a debugger data server on separate thread if the plugin has not started one yet. Returns: A mapping between routes and handlers (functions that respond to requests).
[ "Obtains", "a", "mapping", "between", "routes", "and", "handlers", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/debugger/interactive_debugger_plugin.py#L131-L149
train
Gets a mapping between routes and handlers.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/audio/audio_plugin.py
AudioPlugin.is_active
def is_active(self): """The audio plugin is active iff any run has at least one relevant tag.""" if not self._multiplexer: return False return bool(self._multiplexer.PluginRunToTagToContent(metadata.PLUGIN_NAME))
python
def is_active(self): """The audio plugin is active iff any run has at least one relevant tag.""" if not self._multiplexer: return False return bool(self._multiplexer.PluginRunToTagToContent(metadata.PLUGIN_NAME))
[ "def", "is_active", "(", "self", ")", ":", "if", "not", "self", ".", "_multiplexer", ":", "return", "False", "return", "bool", "(", "self", ".", "_multiplexer", ".", "PluginRunToTagToContent", "(", "metadata", ".", "PLUGIN_NAME", ")", ")" ]
The audio plugin is active iff any run has at least one relevant tag.
[ "The", "audio", "plugin", "is", "active", "iff", "any", "run", "has", "at", "least", "one", "relevant", "tag", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/audio/audio_plugin.py#L59-L63
train
The audio plugin is active iff any run has at least one relevant tag.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/audio/audio_plugin.py
AudioPlugin._index_impl
def _index_impl(self): """Return information about the tags in each run. Result is a dictionary of the form { "runName1": { "tagName1": { "displayName": "The first tag", "description": "<p>Long ago there was just one tag...</p>", "samples...
python
def _index_impl(self): """Return information about the tags in each run. Result is a dictionary of the form { "runName1": { "tagName1": { "displayName": "The first tag", "description": "<p>Long ago there was just one tag...</p>", "samples...
[ "def", "_index_impl", "(", "self", ")", ":", "runs", "=", "self", ".", "_multiplexer", ".", "Runs", "(", ")", "result", "=", "{", "run", ":", "{", "}", "for", "run", "in", "runs", "}", "mapping", "=", "self", ".", "_multiplexer", ".", "PluginRunToTag...
Return information about the tags in each run. Result is a dictionary of the form { "runName1": { "tagName1": { "displayName": "The first tag", "description": "<p>Long ago there was just one tag...</p>", "samples": 3 }, ...
[ "Return", "information", "about", "the", "tags", "in", "each", "run", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/audio/audio_plugin.py#L65-L105
train
Return information about the tags in each run.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/audio/audio_plugin.py
AudioPlugin._serve_audio_metadata
def _serve_audio_metadata(self, request): """Given a tag and list of runs, serve a list of metadata for audio. Note that the actual audio data are not sent; instead, we respond with URLs to the audio. The frontend should treat these URLs as opaque and should not try to parse information about them or ...
python
def _serve_audio_metadata(self, request): """Given a tag and list of runs, serve a list of metadata for audio. Note that the actual audio data are not sent; instead, we respond with URLs to the audio. The frontend should treat these URLs as opaque and should not try to parse information about them or ...
[ "def", "_serve_audio_metadata", "(", "self", ",", "request", ")", ":", "tag", "=", "request", ".", "args", ".", "get", "(", "'tag'", ")", "run", "=", "request", ".", "args", ".", "get", "(", "'run'", ")", "sample", "=", "int", "(", "request", ".", ...
Given a tag and list of runs, serve a list of metadata for audio. Note that the actual audio data are not sent; instead, we respond with URLs to the audio. The frontend should treat these URLs as opaque and should not try to parse information about them or generate them itself, as the format may change...
[ "Given", "a", "tag", "and", "list", "of", "runs", "serve", "a", "list", "of", "metadata", "for", "audio", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/audio/audio_plugin.py#L121-L141
train
This function serves a list of audio metadata for a single run.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/audio/audio_plugin.py
AudioPlugin._audio_response_for_run
def _audio_response_for_run(self, tensor_events, run, tag, sample): """Builds a JSON-serializable object with information about audio. Args: tensor_events: A list of image event_accumulator.TensorEvent objects. run: The name of the run. tag: The name of the tag the audio entries all belong to...
python
def _audio_response_for_run(self, tensor_events, run, tag, sample): """Builds a JSON-serializable object with information about audio. Args: tensor_events: A list of image event_accumulator.TensorEvent objects. run: The name of the run. tag: The name of the tag the audio entries all belong to...
[ "def", "_audio_response_for_run", "(", "self", ",", "tensor_events", ",", "run", ",", "tag", ",", "sample", ")", ":", "response", "=", "[", "]", "index", "=", "0", "filtered_events", "=", "self", ".", "_filter_by_sample", "(", "tensor_events", ",", "sample",...
Builds a JSON-serializable object with information about audio. Args: tensor_events: A list of image event_accumulator.TensorEvent objects. run: The name of the run. tag: The name of the tag the audio entries all belong to. sample: The zero-indexed sample of the audio sample for which to ...
[ "Builds", "a", "JSON", "-", "serializable", "object", "with", "information", "about", "audio", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/audio/audio_plugin.py#L143-L174
train
Builds a JSON - serializable object with information about audio.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/audio/audio_plugin.py
AudioPlugin._query_for_individual_audio
def _query_for_individual_audio(self, run, tag, sample, index): """Builds a URL for accessing the specified audio. This should be kept in sync with _serve_audio_metadata. Note that the URL is *not* guaranteed to always return the same audio, since audio may be unloaded from the reservoir as new audio e...
python
def _query_for_individual_audio(self, run, tag, sample, index): """Builds a URL for accessing the specified audio. This should be kept in sync with _serve_audio_metadata. Note that the URL is *not* guaranteed to always return the same audio, since audio may be unloaded from the reservoir as new audio e...
[ "def", "_query_for_individual_audio", "(", "self", ",", "run", ",", "tag", ",", "sample", ",", "index", ")", ":", "query_string", "=", "urllib", ".", "parse", ".", "urlencode", "(", "{", "'run'", ":", "run", ",", "'tag'", ":", "tag", ",", "'sample'", "...
Builds a URL for accessing the specified audio. This should be kept in sync with _serve_audio_metadata. Note that the URL is *not* guaranteed to always return the same audio, since audio may be unloaded from the reservoir as new audio entries come in. Args: run: The name of the run. tag: T...
[ "Builds", "a", "URL", "for", "accessing", "the", "specified", "audio", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/audio/audio_plugin.py#L176-L198
train
Builds a URL for accessing the specified audio entry in the given run with the given tag and sample and index.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/audio/audio_plugin.py
AudioPlugin._serve_individual_audio
def _serve_individual_audio(self, request): """Serve encoded audio data.""" tag = request.args.get('tag') run = request.args.get('run') index = int(request.args.get('index')) sample = int(request.args.get('sample', 0)) events = self._filter_by_sample(self._multiplexer.Tensors(run, tag), sample) ...
python
def _serve_individual_audio(self, request): """Serve encoded audio data.""" tag = request.args.get('tag') run = request.args.get('run') index = int(request.args.get('index')) sample = int(request.args.get('sample', 0)) events = self._filter_by_sample(self._multiplexer.Tensors(run, tag), sample) ...
[ "def", "_serve_individual_audio", "(", "self", ",", "request", ")", ":", "tag", "=", "request", ".", "args", ".", "get", "(", "'tag'", ")", "run", "=", "request", ".", "args", ".", "get", "(", "'run'", ")", "index", "=", "int", "(", "request", ".", ...
Serve encoded audio data.
[ "Serve", "encoded", "audio", "data", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/audio/audio_plugin.py#L206-L215
train
Serve encoded audio data.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/compat/tensorflow_stub/app.py
_usage
def _usage(shorthelp): """Writes __main__'s docstring to stdout with some help text. Args: shorthelp: bool, if True, prints only flags from the main module, rather than all flags. """ doc = _sys.modules['__main__'].__doc__ if not doc: doc = '\nUSAGE: %s [flags]\n' % _sys.arg...
python
def _usage(shorthelp): """Writes __main__'s docstring to stdout with some help text. Args: shorthelp: bool, if True, prints only flags from the main module, rather than all flags. """ doc = _sys.modules['__main__'].__doc__ if not doc: doc = '\nUSAGE: %s [flags]\n' % _sys.arg...
[ "def", "_usage", "(", "shorthelp", ")", ":", "doc", "=", "_sys", ".", "modules", "[", "'__main__'", "]", ".", "__doc__", "if", "not", "doc", ":", "doc", "=", "'\\nUSAGE: %s [flags]\\n'", "%", "_sys", ".", "argv", "[", "0", "]", "doc", "=", "flags", "...
Writes __main__'s docstring to stdout with some help text. Args: shorthelp: bool, if True, prints only flags from the main module, rather than all flags.
[ "Writes", "__main__", "s", "docstring", "to", "stdout", "with", "some", "help", "text", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/compat/tensorflow_stub/app.py#L27-L60
train
Writes the usage text to stdout with some help text.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/compat/tensorflow_stub/app.py
run
def run(main=None, argv=None): """Runs the program with an optional 'main' function and 'argv' list.""" # Define help flags. _define_help_flags() # Parse known flags. argv = flags.FLAGS(_sys.argv if argv is None else argv, known_only=True) main = main or _sys.modules['__main__'].main # C...
python
def run(main=None, argv=None): """Runs the program with an optional 'main' function and 'argv' list.""" # Define help flags. _define_help_flags() # Parse known flags. argv = flags.FLAGS(_sys.argv if argv is None else argv, known_only=True) main = main or _sys.modules['__main__'].main # C...
[ "def", "run", "(", "main", "=", "None", ",", "argv", "=", "None", ")", ":", "# Define help flags.", "_define_help_flags", "(", ")", "# Parse known flags.", "argv", "=", "flags", ".", "FLAGS", "(", "_sys", ".", "argv", "if", "argv", "is", "None", "else", ...
Runs the program with an optional 'main' function and 'argv' list.
[ "Runs", "the", "program", "with", "an", "optional", "main", "function", "and", "argv", "list", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/compat/tensorflow_stub/app.py#L116-L129
train
Runs the program with an optional main function and argv list.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/image/summary.py
op
def op(name, images, max_outputs=3, display_name=None, description=None, collections=None): """Create a legacy image summary op for use in a TensorFlow graph. Arguments: name: A unique name for the generated summary node. images: A `Tensor` representing pixel data with sh...
python
def op(name, images, max_outputs=3, display_name=None, description=None, collections=None): """Create a legacy image summary op for use in a TensorFlow graph. Arguments: name: A unique name for the generated summary node. images: A `Tensor` representing pixel data with sh...
[ "def", "op", "(", "name", ",", "images", ",", "max_outputs", "=", "3", ",", "display_name", "=", "None", ",", "description", "=", "None", ",", "collections", "=", "None", ")", ":", "# TODO(nickfelt): remove on-demand imports once dep situation is fixed.", "import", ...
Create a legacy image summary op for use in a TensorFlow graph. Arguments: name: A unique name for the generated summary node. images: A `Tensor` representing pixel data with shape `[k, h, w, c]`, where `k` is the number of images, `h` and `w` are the height and width of the images, and `c` is th...
[ "Create", "a", "legacy", "image", "summary", "op", "for", "use", "in", "a", "TensorFlow", "graph", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/image/summary.py#L39-L92
train
Create a legacy image summary op for use in a TensorFlow graph.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/image/summary.py
pb
def pb(name, images, max_outputs=3, display_name=None, description=None): """Create a legacy image summary protobuf. This behaves as if you were to create an `op` with the same arguments (wrapped with constant tensors where appropriate) and then execute that summary op in a TensorFlow session. Arguments: ...
python
def pb(name, images, max_outputs=3, display_name=None, description=None): """Create a legacy image summary protobuf. This behaves as if you were to create an `op` with the same arguments (wrapped with constant tensors where appropriate) and then execute that summary op in a TensorFlow session. Arguments: ...
[ "def", "pb", "(", "name", ",", "images", ",", "max_outputs", "=", "3", ",", "display_name", "=", "None", ",", "description", "=", "None", ")", ":", "# TODO(nickfelt): remove on-demand imports once dep situation is fixed.", "import", "tensorflow", ".", "compat", ".",...
Create a legacy image summary protobuf. This behaves as if you were to create an `op` with the same arguments (wrapped with constant tensors where appropriate) and then execute that summary op in a TensorFlow session. Arguments: name: A unique name for the generated summary, including any desired na...
[ "Create", "a", "legacy", "image", "summary", "protobuf", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/image/summary.py#L95-L145
train
Create a legacy image summary protobuf.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/backend/application.py
tensor_size_guidance_from_flags
def tensor_size_guidance_from_flags(flags): """Apply user per-summary size guidance overrides.""" tensor_size_guidance = dict(DEFAULT_TENSOR_SIZE_GUIDANCE) if not flags or not flags.samples_per_plugin: return tensor_size_guidance for token in flags.samples_per_plugin.split(','): k, v = token.strip().s...
python
def tensor_size_guidance_from_flags(flags): """Apply user per-summary size guidance overrides.""" tensor_size_guidance = dict(DEFAULT_TENSOR_SIZE_GUIDANCE) if not flags or not flags.samples_per_plugin: return tensor_size_guidance for token in flags.samples_per_plugin.split(','): k, v = token.strip().s...
[ "def", "tensor_size_guidance_from_flags", "(", "flags", ")", ":", "tensor_size_guidance", "=", "dict", "(", "DEFAULT_TENSOR_SIZE_GUIDANCE", ")", "if", "not", "flags", "or", "not", "flags", ".", "samples_per_plugin", ":", "return", "tensor_size_guidance", "for", "token...
Apply user per-summary size guidance overrides.
[ "Apply", "user", "per", "-", "summary", "size", "guidance", "overrides", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/application.py#L80-L91
train
Apply user per - summary size guidance overrides.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/backend/application.py
standard_tensorboard_wsgi
def standard_tensorboard_wsgi(flags, plugin_loaders, assets_zip_provider): """Construct a TensorBoardWSGIApp with standard plugins and multiplexer. Args: flags: An argparse.Namespace containing TensorBoard CLI flags. plugin_loaders: A list of TBLoader instances. assets_zip_provider: See TBContext docum...
python
def standard_tensorboard_wsgi(flags, plugin_loaders, assets_zip_provider): """Construct a TensorBoardWSGIApp with standard plugins and multiplexer. Args: flags: An argparse.Namespace containing TensorBoard CLI flags. plugin_loaders: A list of TBLoader instances. assets_zip_provider: See TBContext docum...
[ "def", "standard_tensorboard_wsgi", "(", "flags", ",", "plugin_loaders", ",", "assets_zip_provider", ")", ":", "multiplexer", "=", "event_multiplexer", ".", "EventMultiplexer", "(", "size_guidance", "=", "DEFAULT_SIZE_GUIDANCE", ",", "tensor_size_guidance", "=", "tensor_s...
Construct a TensorBoardWSGIApp with standard plugins and multiplexer. Args: flags: An argparse.Namespace containing TensorBoard CLI flags. plugin_loaders: A list of TBLoader instances. assets_zip_provider: See TBContext documentation for more information. Returns: The new TensorBoard WSGI applicat...
[ "Construct", "a", "TensorBoardWSGIApp", "with", "standard", "plugins", "and", "multiplexer", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/application.py#L94-L160
train
Construct a TensorBoard WSGI application with standard plugins and multiplexer.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/backend/application.py
TensorBoardWSGIApp
def TensorBoardWSGIApp(logdir, plugins, multiplexer, reload_interval, path_prefix='', reload_task='auto'): """Constructs the TensorBoard application. Args: logdir: the logdir spec that describes where data will be loaded. may be a directory, or comma,separated list of directories, ...
python
def TensorBoardWSGIApp(logdir, plugins, multiplexer, reload_interval, path_prefix='', reload_task='auto'): """Constructs the TensorBoard application. Args: logdir: the logdir spec that describes where data will be loaded. may be a directory, or comma,separated list of directories, ...
[ "def", "TensorBoardWSGIApp", "(", "logdir", ",", "plugins", ",", "multiplexer", ",", "reload_interval", ",", "path_prefix", "=", "''", ",", "reload_task", "=", "'auto'", ")", ":", "path_to_run", "=", "parse_event_files_spec", "(", "logdir", ")", "if", "reload_in...
Constructs the TensorBoard application. Args: logdir: the logdir spec that describes where data will be loaded. may be a directory, or comma,separated list of directories, or colons can be used to provide named directories plugins: A list of base_plugin.TBPlugin subclass instances. multiplexe...
[ "Constructs", "the", "TensorBoard", "application", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/application.py#L163-L193
train
Constructs a TensorBoard WSGI application.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/backend/application.py
parse_event_files_spec
def parse_event_files_spec(logdir): """Parses `logdir` into a map from paths to run group names. The events files flag format is a comma-separated list of path specifications. A path specification either looks like 'group_name:/path/to/directory' or '/path/to/directory'; in the latter case, the group is unname...
python
def parse_event_files_spec(logdir): """Parses `logdir` into a map from paths to run group names. The events files flag format is a comma-separated list of path specifications. A path specification either looks like 'group_name:/path/to/directory' or '/path/to/directory'; in the latter case, the group is unname...
[ "def", "parse_event_files_spec", "(", "logdir", ")", ":", "files", "=", "{", "}", "if", "logdir", "is", "None", ":", "return", "files", "# Make sure keeping consistent with ParseURI in core/lib/io/path.cc", "uri_pattern", "=", "re", ".", "compile", "(", "'[a-zA-Z][0-9...
Parses `logdir` into a map from paths to run group names. The events files flag format is a comma-separated list of path specifications. A path specification either looks like 'group_name:/path/to/directory' or '/path/to/directory'; in the latter case, the group is unnamed. Group names cannot start with a forw...
[ "Parses", "logdir", "into", "a", "map", "from", "paths", "to", "run", "group", "names", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/application.py#L317-L357
train
Parses the logdir into a dict mapping directory paths to run group names.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/backend/application.py
start_reloading_multiplexer
def start_reloading_multiplexer(multiplexer, path_to_run, load_interval, reload_task): """Starts automatically reloading the given multiplexer. If `load_interval` is positive, the thread will reload the multiplexer by calling `ReloadMultiplexer` every `load_interval` seconds, star...
python
def start_reloading_multiplexer(multiplexer, path_to_run, load_interval, reload_task): """Starts automatically reloading the given multiplexer. If `load_interval` is positive, the thread will reload the multiplexer by calling `ReloadMultiplexer` every `load_interval` seconds, star...
[ "def", "start_reloading_multiplexer", "(", "multiplexer", ",", "path_to_run", ",", "load_interval", ",", "reload_task", ")", ":", "if", "load_interval", "<", "0", ":", "raise", "ValueError", "(", "'load_interval is negative: %d'", "%", "load_interval", ")", "def", "...
Starts automatically reloading the given multiplexer. If `load_interval` is positive, the thread will reload the multiplexer by calling `ReloadMultiplexer` every `load_interval` seconds, starting immediately. Otherwise, reloads the multiplexer once and never again. Args: multiplexer: The `EventMultiplexer...
[ "Starts", "automatically", "reloading", "the", "given", "multiplexer", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/application.py#L360-L417
train
Starts automatically reloading the given multiplexer.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/backend/application.py
get_database_info
def get_database_info(db_uri): """Returns TBContext fields relating to SQL database. Args: db_uri: A string URI expressing the DB file, e.g. "sqlite:~/tb.db". Returns: A tuple with the db_module and db_connection_provider TBContext fields. If db_uri was empty, then (None, None) is returned. Raise...
python
def get_database_info(db_uri): """Returns TBContext fields relating to SQL database. Args: db_uri: A string URI expressing the DB file, e.g. "sqlite:~/tb.db". Returns: A tuple with the db_module and db_connection_provider TBContext fields. If db_uri was empty, then (None, None) is returned. Raise...
[ "def", "get_database_info", "(", "db_uri", ")", ":", "if", "not", "db_uri", ":", "return", "None", ",", "None", "scheme", "=", "urlparse", ".", "urlparse", "(", "db_uri", ")", ".", "scheme", "if", "scheme", "==", "'sqlite'", ":", "return", "sqlite3", ","...
Returns TBContext fields relating to SQL database. Args: db_uri: A string URI expressing the DB file, e.g. "sqlite:~/tb.db". Returns: A tuple with the db_module and db_connection_provider TBContext fields. If db_uri was empty, then (None, None) is returned. Raises: ValueError: If db_uri scheme ...
[ "Returns", "TBContext", "fields", "relating", "to", "SQL", "database", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/application.py#L420-L439
train
Returns the database module and connection provider TBContext fields relating to SQL database.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/backend/application.py
create_sqlite_connection_provider
def create_sqlite_connection_provider(db_uri): """Returns function that returns SQLite Connection objects. Args: db_uri: A string URI expressing the DB file, e.g. "sqlite:~/tb.db". Returns: A function that returns a new PEP-249 DB Connection, which must be closed, each time it is called. Raises: ...
python
def create_sqlite_connection_provider(db_uri): """Returns function that returns SQLite Connection objects. Args: db_uri: A string URI expressing the DB file, e.g. "sqlite:~/tb.db". Returns: A function that returns a new PEP-249 DB Connection, which must be closed, each time it is called. Raises: ...
[ "def", "create_sqlite_connection_provider", "(", "db_uri", ")", ":", "uri", "=", "urlparse", ".", "urlparse", "(", "db_uri", ")", "if", "uri", ".", "scheme", "!=", "'sqlite'", ":", "raise", "ValueError", "(", "'Scheme is not sqlite: '", "+", "db_uri", ")", "if...
Returns function that returns SQLite Connection objects. Args: db_uri: A string URI expressing the DB file, e.g. "sqlite:~/tb.db". Returns: A function that returns a new PEP-249 DB Connection, which must be closed, each time it is called. Raises: ValueError: If db_uri is not a valid sqlite file...
[ "Returns", "function", "that", "returns", "SQLite", "Connection", "objects", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/application.py#L442-L465
train
Creates a function that returns a new SQLite Connection object.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/backend/application.py
TensorBoardWSGI._serve_plugins_listing
def _serve_plugins_listing(self, request): """Serves an object mapping plugin name to whether it is enabled. Args: request: The werkzeug.Request object. Returns: A werkzeug.Response object. """ response = {} for plugin in self._plugins: start = time.time() response[plug...
python
def _serve_plugins_listing(self, request): """Serves an object mapping plugin name to whether it is enabled. Args: request: The werkzeug.Request object. Returns: A werkzeug.Response object. """ response = {} for plugin in self._plugins: start = time.time() response[plug...
[ "def", "_serve_plugins_listing", "(", "self", ",", "request", ")", ":", "response", "=", "{", "}", "for", "plugin", "in", "self", ".", "_plugins", ":", "start", "=", "time", ".", "time", "(", ")", "response", "[", "plugin", ".", "plugin_name", "]", "="...
Serves an object mapping plugin name to whether it is enabled. Args: request: The werkzeug.Request object. Returns: A werkzeug.Response object.
[ "Serves", "an", "object", "mapping", "plugin", "name", "to", "whether", "it", "is", "enabled", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/application.py#L268-L285
train
Serves an object mapping plugin name to whether it is enabled.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/debugger/tensor_helper.py
parse_time_indices
def parse_time_indices(s): """Parse a string as time indices. Args: s: A valid slicing string for time indices. E.g., '-1', '[:]', ':', '2:10' Returns: A slice object. Raises: ValueError: If `s` does not represent valid time indices. """ if not s.startswith('['): s = '[' + s + ']' parse...
python
def parse_time_indices(s): """Parse a string as time indices. Args: s: A valid slicing string for time indices. E.g., '-1', '[:]', ':', '2:10' Returns: A slice object. Raises: ValueError: If `s` does not represent valid time indices. """ if not s.startswith('['): s = '[' + s + ']' parse...
[ "def", "parse_time_indices", "(", "s", ")", ":", "if", "not", "s", ".", "startswith", "(", "'['", ")", ":", "s", "=", "'['", "+", "s", "+", "']'", "parsed", "=", "command_parser", ".", "_parse_slices", "(", "s", ")", "if", "len", "(", "parsed", ")"...
Parse a string as time indices. Args: s: A valid slicing string for time indices. E.g., '-1', '[:]', ':', '2:10' Returns: A slice object. Raises: ValueError: If `s` does not represent valid time indices.
[ "Parse", "a", "string", "as", "time", "indices", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/debugger/tensor_helper.py#L43-L62
train
Parse a string as time indices.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/debugger/tensor_helper.py
process_buffers_for_display
def process_buffers_for_display(s, limit=40): """Process a buffer for human-readable display. This function performs the following operation on each of the buffers in `s`. 1. Truncate input buffer if the length of the buffer is greater than `limit`, to prevent large strings from overloading the frontend...
python
def process_buffers_for_display(s, limit=40): """Process a buffer for human-readable display. This function performs the following operation on each of the buffers in `s`. 1. Truncate input buffer if the length of the buffer is greater than `limit`, to prevent large strings from overloading the frontend...
[ "def", "process_buffers_for_display", "(", "s", ",", "limit", "=", "40", ")", ":", "if", "isinstance", "(", "s", ",", "(", "list", ",", "tuple", ")", ")", ":", "return", "[", "process_buffers_for_display", "(", "elem", ",", "limit", "=", "limit", ")", ...
Process a buffer for human-readable display. This function performs the following operation on each of the buffers in `s`. 1. Truncate input buffer if the length of the buffer is greater than `limit`, to prevent large strings from overloading the frontend. 2. Apply `binascii.b2a_qp` on the truncated b...
[ "Process", "a", "buffer", "for", "human", "-", "readable", "display", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/debugger/tensor_helper.py#L83-L110
train
Process a buffer for human - readable display.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/debugger/tensor_helper.py
array_view
def array_view(array, slicing=None, mapping=None): """View a slice or the entirety of an ndarray. Args: array: The input array, as an numpy.ndarray. slicing: Optional slicing string, e.g., "[:, 1:3, :]". mapping: Optional mapping string. Supported mappings: `None` or case-insensitive `'None'`: Un...
python
def array_view(array, slicing=None, mapping=None): """View a slice or the entirety of an ndarray. Args: array: The input array, as an numpy.ndarray. slicing: Optional slicing string, e.g., "[:, 1:3, :]". mapping: Optional mapping string. Supported mappings: `None` or case-insensitive `'None'`: Un...
[ "def", "array_view", "(", "array", ",", "slicing", "=", "None", ",", "mapping", "=", "None", ")", ":", "dtype", "=", "translate_dtype", "(", "array", ".", "dtype", ")", "sliced_array", "=", "(", "array", "[", "command_parser", ".", "_parse_slices", "(", ...
View a slice or the entirety of an ndarray. Args: array: The input array, as an numpy.ndarray. slicing: Optional slicing string, e.g., "[:, 1:3, :]". mapping: Optional mapping string. Supported mappings: `None` or case-insensitive `'None'`: Unmapped nested list. `'image/png'`: Image encoding ...
[ "View", "a", "slice", "or", "the", "entirety", "of", "an", "ndarray", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/debugger/tensor_helper.py#L113-L165
train
View a nested list of arrays.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/debugger/tensor_helper.py
array_to_base64_png
def array_to_base64_png(array): """Convert an array into base64-enoded PNG image. Args: array: A 2D np.ndarray or nested list of items. Returns: A base64-encoded string the image. The image is grayscale if the array is 2D. The image is RGB color if the image is 3D with lsat dimension equal to 3....
python
def array_to_base64_png(array): """Convert an array into base64-enoded PNG image. Args: array: A 2D np.ndarray or nested list of items. Returns: A base64-encoded string the image. The image is grayscale if the array is 2D. The image is RGB color if the image is 3D with lsat dimension equal to 3....
[ "def", "array_to_base64_png", "(", "array", ")", ":", "# TODO(cais): Deal with 3D case.", "# TODO(cais): If there are None values in here, replace them with all NaNs.", "array", "=", "np", ".", "array", "(", "array", ",", "dtype", "=", "np", ".", "float32", ")", "if", "...
Convert an array into base64-enoded PNG image. Args: array: A 2D np.ndarray or nested list of items. Returns: A base64-encoded string the image. The image is grayscale if the array is 2D. The image is RGB color if the image is 3D with lsat dimension equal to 3. Raises: ValueError: If the in...
[ "Convert", "an", "array", "into", "base64", "-", "enoded", "PNG", "image", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/debugger/tensor_helper.py#L174-L223
train
Convert an array into base64 - noded PNG image.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/graph/graph_util.py
_safe_copy_proto_list_values
def _safe_copy_proto_list_values(dst_proto_list, src_proto_list, get_key): """Safely merge values from `src_proto_list` into `dst_proto_list`. Each element in `dst_proto_list` must be mapped by `get_key` to a key value that is unique within that list; likewise for `src_proto_list`. If an element of `src_proto_...
python
def _safe_copy_proto_list_values(dst_proto_list, src_proto_list, get_key): """Safely merge values from `src_proto_list` into `dst_proto_list`. Each element in `dst_proto_list` must be mapped by `get_key` to a key value that is unique within that list; likewise for `src_proto_list`. If an element of `src_proto_...
[ "def", "_safe_copy_proto_list_values", "(", "dst_proto_list", ",", "src_proto_list", ",", "get_key", ")", ":", "def", "_assert_proto_container_unique_keys", "(", "proto_list", ",", "get_key", ")", ":", "\"\"\"Asserts proto_list to only contains unique keys.\n\n Args:\n pr...
Safely merge values from `src_proto_list` into `dst_proto_list`. Each element in `dst_proto_list` must be mapped by `get_key` to a key value that is unique within that list; likewise for `src_proto_list`. If an element of `src_proto_list` has the same key as an existing element in `dst_proto_list`, then the el...
[ "Safely", "merge", "values", "from", "src_proto_list", "into", "dst_proto_list", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/graph/graph_util.py#L27-L87
train
Safely merge values from src_proto_list into dst_proto_list.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/graph/graph_util.py
combine_graph_defs
def combine_graph_defs(to_proto, from_proto): """Combines two GraphDefs by adding nodes from from_proto into to_proto. All GraphDefs are expected to be of TensorBoard's. It assumes node names are unique across GraphDefs if contents differ. The names can be the same if the NodeDef content are exactly the same. ...
python
def combine_graph_defs(to_proto, from_proto): """Combines two GraphDefs by adding nodes from from_proto into to_proto. All GraphDefs are expected to be of TensorBoard's. It assumes node names are unique across GraphDefs if contents differ. The names can be the same if the NodeDef content are exactly the same. ...
[ "def", "combine_graph_defs", "(", "to_proto", ",", "from_proto", ")", ":", "if", "from_proto", ".", "version", "!=", "to_proto", ".", "version", ":", "raise", "ValueError", "(", "'Cannot combine GraphDefs of different versions.'", ")", "try", ":", "_safe_copy_proto_li...
Combines two GraphDefs by adding nodes from from_proto into to_proto. All GraphDefs are expected to be of TensorBoard's. It assumes node names are unique across GraphDefs if contents differ. The names can be the same if the NodeDef content are exactly the same. Args: to_proto: A destination TensorBoard Gr...
[ "Combines", "two", "GraphDefs", "by", "adding", "nodes", "from", "from_proto", "into", "to_proto", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/graph/graph_util.py#L90-L150
train
Combines two TensorBoard GraphDefs by adding nodes from from_proto into to_proto.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/scalar/summary_v2.py
scalar
def scalar(name, data, step=None, description=None): """Write a scalar summary. Arguments: name: A name for this summary. The summary tag used for TensorBoard will be this name prefixed by any active name scopes. data: A real numeric scalar value, convertible to a `float32` Tensor. step: Explicit...
python
def scalar(name, data, step=None, description=None): """Write a scalar summary. Arguments: name: A name for this summary. The summary tag used for TensorBoard will be this name prefixed by any active name scopes. data: A real numeric scalar value, convertible to a `float32` Tensor. step: Explicit...
[ "def", "scalar", "(", "name", ",", "data", ",", "step", "=", "None", ",", "description", "=", "None", ")", ":", "summary_metadata", "=", "metadata", ".", "create_summary_metadata", "(", "display_name", "=", "None", ",", "description", "=", "description", ")"...
Write a scalar summary. Arguments: name: A name for this summary. The summary tag used for TensorBoard will be this name prefixed by any active name scopes. data: A real numeric scalar value, convertible to a `float32` Tensor. step: Explicit `int64`-castable monotonic step value for this summary. I...
[ "Write", "a", "scalar", "summary", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/scalar/summary_v2.py#L32-L65
train
Writes a scalar summary.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/scalar/summary_v2.py
scalar_pb
def scalar_pb(tag, data, description=None): """Create a scalar summary_pb2.Summary protobuf. Arguments: tag: String tag for the summary. data: A 0-dimensional `np.array` or a compatible python number type. description: Optional long-form description for this summary, as a `str`. Markdown is suppo...
python
def scalar_pb(tag, data, description=None): """Create a scalar summary_pb2.Summary protobuf. Arguments: tag: String tag for the summary. data: A 0-dimensional `np.array` or a compatible python number type. description: Optional long-form description for this summary, as a `str`. Markdown is suppo...
[ "def", "scalar_pb", "(", "tag", ",", "data", ",", "description", "=", "None", ")", ":", "arr", "=", "np", ".", "array", "(", "data", ")", "if", "arr", ".", "shape", "!=", "(", ")", ":", "raise", "ValueError", "(", "'Expected scalar shape for tensor, got ...
Create a scalar summary_pb2.Summary protobuf. Arguments: tag: String tag for the summary. data: A 0-dimensional `np.array` or a compatible python number type. description: Optional long-form description for this summary, as a `str`. Markdown is supported. Defaults to empty. Raises: ValueErro...
[ "Create", "a", "scalar", "summary_pb2", ".", "Summary", "protobuf", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/scalar/summary_v2.py#L68-L96
train
Create a scalar summary_pb2. Summary protobuf.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/profile/profile_demo.py
dump_data
def dump_data(logdir): """Dumps plugin data to the log directory.""" # Create a tfevents file in the logdir so it is detected as a run. write_empty_event_file(logdir) plugin_logdir = plugin_asset_util.PluginDirectory( logdir, profile_plugin.ProfilePlugin.plugin_name) _maybe_create_directory(plugin_logd...
python
def dump_data(logdir): """Dumps plugin data to the log directory.""" # Create a tfevents file in the logdir so it is detected as a run. write_empty_event_file(logdir) plugin_logdir = plugin_asset_util.PluginDirectory( logdir, profile_plugin.ProfilePlugin.plugin_name) _maybe_create_directory(plugin_logd...
[ "def", "dump_data", "(", "logdir", ")", ":", "# Create a tfevents file in the logdir so it is detected as a run.", "write_empty_event_file", "(", "logdir", ")", "plugin_logdir", "=", "plugin_asset_util", ".", "PluginDirectory", "(", "logdir", ",", "profile_plugin", ".", "Pr...
Dumps plugin data to the log directory.
[ "Dumps", "plugin", "data", "to", "the", "log", "directory", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/profile/profile_demo.py#L67-L102
train
Dumps plugin data to the log directory.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/debugger/health_pill_calc.py
calc_health_pill
def calc_health_pill(tensor): """Calculate health pill of a tensor. Args: tensor: An instance of `np.array` (for initialized tensors) or `tensorflow.python.debug.lib.debug_data.InconvertibleTensorProto` (for unininitialized tensors). Returns: If `tensor` is an initialized tensor of numeric o...
python
def calc_health_pill(tensor): """Calculate health pill of a tensor. Args: tensor: An instance of `np.array` (for initialized tensors) or `tensorflow.python.debug.lib.debug_data.InconvertibleTensorProto` (for unininitialized tensors). Returns: If `tensor` is an initialized tensor of numeric o...
[ "def", "calc_health_pill", "(", "tensor", ")", ":", "health_pill", "=", "[", "0.0", "]", "*", "14", "# TODO(cais): Add unit test for this method that compares results with", "# DebugNumericSummary output.", "# Is tensor initialized.", "if", "not", "isinstance", "(", "tensor...
Calculate health pill of a tensor. Args: tensor: An instance of `np.array` (for initialized tensors) or `tensorflow.python.debug.lib.debug_data.InconvertibleTensorProto` (for unininitialized tensors). Returns: If `tensor` is an initialized tensor of numeric or boolean types: the calculat...
[ "Calculate", "health", "pill", "of", "a", "tensor", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/debugger/health_pill_calc.py#L34-L118
train
Calculates the health pill of a tensor.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/beholder/beholder.py
Beholder._get_config
def _get_config(self): '''Reads the config file from disk or creates a new one.''' filename = '{}/{}'.format(self.PLUGIN_LOGDIR, CONFIG_FILENAME) modified_time = os.path.getmtime(filename) if modified_time != self.config_last_modified_time: config = read_pickle(filename, default=self.previous_con...
python
def _get_config(self): '''Reads the config file from disk or creates a new one.''' filename = '{}/{}'.format(self.PLUGIN_LOGDIR, CONFIG_FILENAME) modified_time = os.path.getmtime(filename) if modified_time != self.config_last_modified_time: config = read_pickle(filename, default=self.previous_con...
[ "def", "_get_config", "(", "self", ")", ":", "filename", "=", "'{}/{}'", ".", "format", "(", "self", ".", "PLUGIN_LOGDIR", ",", "CONFIG_FILENAME", ")", "modified_time", "=", "os", ".", "path", ".", "getmtime", "(", "filename", ")", "if", "modified_time", "...
Reads the config file from disk or creates a new one.
[ "Reads", "the", "config", "file", "from", "disk", "or", "creates", "a", "new", "one", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/beholder/beholder.py#L70-L82
train
Reads the config file from disk or creates a new one.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/beholder/beholder.py
Beholder._write_summary
def _write_summary(self, session, frame): '''Writes the frame to disk as a tensor summary.''' summary = session.run(self.summary_op, feed_dict={ self.frame_placeholder: frame }) path = '{}/{}'.format(self.PLUGIN_LOGDIR, SUMMARY_FILENAME) write_file(summary, path)
python
def _write_summary(self, session, frame): '''Writes the frame to disk as a tensor summary.''' summary = session.run(self.summary_op, feed_dict={ self.frame_placeholder: frame }) path = '{}/{}'.format(self.PLUGIN_LOGDIR, SUMMARY_FILENAME) write_file(summary, path)
[ "def", "_write_summary", "(", "self", ",", "session", ",", "frame", ")", ":", "summary", "=", "session", ".", "run", "(", "self", ".", "summary_op", ",", "feed_dict", "=", "{", "self", ".", "frame_placeholder", ":", "frame", "}", ")", "path", "=", "'{}...
Writes the frame to disk as a tensor summary.
[ "Writes", "the", "frame", "to", "disk", "as", "a", "tensor", "summary", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/beholder/beholder.py#L85-L91
train
Writes the frame to disk as a tensor summary.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/beholder/beholder.py
Beholder._enough_time_has_passed
def _enough_time_has_passed(self, FPS): '''For limiting how often frames are computed.''' if FPS == 0: return False else: earliest_time = self.last_update_time + (1.0 / FPS) return time.time() >= earliest_time
python
def _enough_time_has_passed(self, FPS): '''For limiting how often frames are computed.''' if FPS == 0: return False else: earliest_time = self.last_update_time + (1.0 / FPS) return time.time() >= earliest_time
[ "def", "_enough_time_has_passed", "(", "self", ",", "FPS", ")", ":", "if", "FPS", "==", "0", ":", "return", "False", "else", ":", "earliest_time", "=", "self", ".", "last_update_time", "+", "(", "1.0", "/", "FPS", ")", "return", "time", ".", "time", "(...
For limiting how often frames are computed.
[ "For", "limiting", "how", "often", "frames", "are", "computed", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/beholder/beholder.py#L121-L127
train
For limiting how often frames are computed.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/beholder/beholder.py
Beholder._update_recording
def _update_recording(self, frame, config): '''Adds a frame to the current video output.''' # pylint: disable=redefined-variable-type should_record = config['is_recording'] if should_record: if not self.is_recording: self.is_recording = True logger.info( 'Starting reco...
python
def _update_recording(self, frame, config): '''Adds a frame to the current video output.''' # pylint: disable=redefined-variable-type should_record = config['is_recording'] if should_record: if not self.is_recording: self.is_recording = True logger.info( 'Starting reco...
[ "def", "_update_recording", "(", "self", ",", "frame", ",", "config", ")", ":", "# pylint: disable=redefined-variable-type", "should_record", "=", "config", "[", "'is_recording'", "]", "if", "should_record", ":", "if", "not", "self", ".", "is_recording", ":", "sel...
Adds a frame to the current video output.
[ "Adds", "a", "frame", "to", "the", "current", "video", "output", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/beholder/beholder.py#L138-L153
train
Adds a frame to the current video output.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/beholder/beholder.py
Beholder.update
def update(self, session, arrays=None, frame=None): '''Creates a frame and writes it to disk. Args: arrays: a list of np arrays. Use the "custom" option in the client. frame: a 2D np array. This way the plugin can be used for video of any kind, not just the visualization that comes wit...
python
def update(self, session, arrays=None, frame=None): '''Creates a frame and writes it to disk. Args: arrays: a list of np arrays. Use the "custom" option in the client. frame: a 2D np array. This way the plugin can be used for video of any kind, not just the visualization that comes wit...
[ "def", "update", "(", "self", ",", "session", ",", "arrays", "=", "None", ",", "frame", "=", "None", ")", ":", "new_config", "=", "self", ".", "_get_config", "(", ")", "if", "self", ".", "_enough_time_has_passed", "(", "self", ".", "previous_config", "["...
Creates a frame and writes it to disk. Args: arrays: a list of np arrays. Use the "custom" option in the client. frame: a 2D np array. This way the plugin can be used for video of any kind, not just the visualization that comes with the plugin. frame can also be a function, w...
[ "Creates", "a", "frame", "and", "writes", "it", "to", "disk", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/beholder/beholder.py#L158-L175
train
Creates a frame and writes it to disk.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/beholder/beholder.py
Beholder.gradient_helper
def gradient_helper(optimizer, loss, var_list=None): '''A helper to get the gradients out at each step. Args: optimizer: the optimizer op. loss: the op that computes your loss value. Returns: the gradient tensors and the train_step op. ''' if var_list is None: var_list = tf.compa...
python
def gradient_helper(optimizer, loss, var_list=None): '''A helper to get the gradients out at each step. Args: optimizer: the optimizer op. loss: the op that computes your loss value. Returns: the gradient tensors and the train_step op. ''' if var_list is None: var_list = tf.compa...
[ "def", "gradient_helper", "(", "optimizer", ",", "loss", ",", "var_list", "=", "None", ")", ":", "if", "var_list", "is", "None", ":", "var_list", "=", "tf", ".", "compat", ".", "v1", ".", "trainable_variables", "(", ")", "grads_and_vars", "=", "optimizer",...
A helper to get the gradients out at each step. Args: optimizer: the optimizer op. loss: the op that computes your loss value. Returns: the gradient tensors and the train_step op.
[ "A", "helper", "to", "get", "the", "gradients", "out", "at", "each", "step", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/beholder/beholder.py#L181-L196
train
A helper to get the gradients out at each step.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/hparams/list_session_groups.py
_create_key_func
def _create_key_func(extractor, none_is_largest): """Returns a key_func to be used in list.sort(). Returns a key_func to be used in list.sort() that sorts session groups by the value extracted by extractor. 'None' extracted values will either be considered largest or smallest as specified by the "none_is_large...
python
def _create_key_func(extractor, none_is_largest): """Returns a key_func to be used in list.sort(). Returns a key_func to be used in list.sort() that sorts session groups by the value extracted by extractor. 'None' extracted values will either be considered largest or smallest as specified by the "none_is_large...
[ "def", "_create_key_func", "(", "extractor", ",", "none_is_largest", ")", ":", "if", "none_is_largest", ":", "def", "key_func_none_is_largest", "(", "session_group", ")", ":", "value", "=", "extractor", "(", "session_group", ")", "return", "(", "value", "is", "N...
Returns a key_func to be used in list.sort(). Returns a key_func to be used in list.sort() that sorts session groups by the value extracted by extractor. 'None' extracted values will either be considered largest or smallest as specified by the "none_is_largest" boolean parameter. Args: extractor: An ext...
[ "Returns", "a", "key_func", "to", "be", "used", "in", "list", ".", "sort", "()", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/hparams/list_session_groups.py#L236-L259
train
Create a key_func to be used in list. sort.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/hparams/list_session_groups.py
_create_extractors
def _create_extractors(col_params): """Creates extractors to extract properties corresponding to 'col_params'. Args: col_params: List of ListSessionGroupsRequest.ColParam protobufs. Returns: A list of extractor functions. The ith element in the returned list extracts the column corresponding to the i...
python
def _create_extractors(col_params): """Creates extractors to extract properties corresponding to 'col_params'. Args: col_params: List of ListSessionGroupsRequest.ColParam protobufs. Returns: A list of extractor functions. The ith element in the returned list extracts the column corresponding to the i...
[ "def", "_create_extractors", "(", "col_params", ")", ":", "result", "=", "[", "]", "for", "col_param", "in", "col_params", ":", "result", ".", "append", "(", "_create_extractor", "(", "col_param", ")", ")", "return", "result" ]
Creates extractors to extract properties corresponding to 'col_params'. Args: col_params: List of ListSessionGroupsRequest.ColParam protobufs. Returns: A list of extractor functions. The ith element in the returned list extracts the column corresponding to the ith element of _request.col_params
[ "Creates", "extractors", "to", "extract", "properties", "corresponding", "to", "col_params", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/hparams/list_session_groups.py#L264-L277
train
Creates extractors to extract properties corresponding to col_params.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/hparams/list_session_groups.py
_create_metric_extractor
def _create_metric_extractor(metric_name): """Returns function that extracts a metric from a session group or a session. Args: metric_name: tensorboard.hparams.MetricName protobuffer. Identifies the metric to extract from the session group. Returns: A function that takes a tensorboard.hparams.Session...
python
def _create_metric_extractor(metric_name): """Returns function that extracts a metric from a session group or a session. Args: metric_name: tensorboard.hparams.MetricName protobuffer. Identifies the metric to extract from the session group. Returns: A function that takes a tensorboard.hparams.Session...
[ "def", "_create_metric_extractor", "(", "metric_name", ")", ":", "def", "extractor_fn", "(", "session_or_group", ")", ":", "metric_value", "=", "_find_metric_value", "(", "session_or_group", ",", "metric_name", ")", "return", "metric_value", ".", "value", "if", "met...
Returns function that extracts a metric from a session group or a session. Args: metric_name: tensorboard.hparams.MetricName protobuffer. Identifies the metric to extract from the session group. Returns: A function that takes a tensorboard.hparams.SessionGroup or tensorborad.hparams.Session protobu...
[ "Returns", "function", "that", "extracts", "a", "metric", "from", "a", "session", "group", "or", "a", "session", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/hparams/list_session_groups.py#L291-L307
train
Creates a function that extracts a metric from a session group or a session.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/hparams/list_session_groups.py
_find_metric_value
def _find_metric_value(session_or_group, metric_name): """Returns the metric_value for a given metric in a session or session group. Args: session_or_group: A Session protobuffer or SessionGroup protobuffer. metric_name: A MetricName protobuffer. The metric to search for. Returns: A MetricValue proto...
python
def _find_metric_value(session_or_group, metric_name): """Returns the metric_value for a given metric in a session or session group. Args: session_or_group: A Session protobuffer or SessionGroup protobuffer. metric_name: A MetricName protobuffer. The metric to search for. Returns: A MetricValue proto...
[ "def", "_find_metric_value", "(", "session_or_group", ",", "metric_name", ")", ":", "# Note: We can speed this up by converting the metric_values field", "# to a dictionary on initialization, to avoid a linear search here. We'll", "# need to wrap the SessionGroup and Session protos in a python o...
Returns the metric_value for a given metric in a session or session group. Args: session_or_group: A Session protobuffer or SessionGroup protobuffer. metric_name: A MetricName protobuffer. The metric to search for. Returns: A MetricValue protobuffer representing the value of the given metric or Non...
[ "Returns", "the", "metric_value", "for", "a", "given", "metric", "in", "a", "session", "or", "session", "group", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/hparams/list_session_groups.py#L310-L327
train
Returns the metric_value for a given metric in a given session or session group.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/hparams/list_session_groups.py
_create_hparam_extractor
def _create_hparam_extractor(hparam_name): """Returns an extractor function that extracts an hparam from a session group. Args: hparam_name: str. Identies the hparam to extract from the session group. Returns: A function that takes a tensorboard.hparams.SessionGroup protobuffer and returns the value,...
python
def _create_hparam_extractor(hparam_name): """Returns an extractor function that extracts an hparam from a session group. Args: hparam_name: str. Identies the hparam to extract from the session group. Returns: A function that takes a tensorboard.hparams.SessionGroup protobuffer and returns the value,...
[ "def", "_create_hparam_extractor", "(", "hparam_name", ")", ":", "def", "extractor_fn", "(", "session_group", ")", ":", "if", "hparam_name", "in", "session_group", ".", "hparams", ":", "return", "_value_to_python", "(", "session_group", ".", "hparams", "[", "hpara...
Returns an extractor function that extracts an hparam from a session group. Args: hparam_name: str. Identies the hparam to extract from the session group. Returns: A function that takes a tensorboard.hparams.SessionGroup protobuffer and returns the value, as a native Python object, of the hparam identi...
[ "Returns", "an", "extractor", "function", "that", "extracts", "an", "hparam", "from", "a", "session", "group", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/hparams/list_session_groups.py#L330-L345
train
Creates an extractor function that extracts an hparam from a tensorboard. hparams. SessionGroup protobuffer and returns the value as a native Python object of the hparam identified by hparam_name.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/hparams/list_session_groups.py
_create_filters
def _create_filters(col_params, extractors): """Creates filters for the given col_params. Args: col_params: List of ListSessionGroupsRequest.ColParam protobufs. extractors: list of extractor functions of the same length as col_params. Each element should extract the column described by the correspond...
python
def _create_filters(col_params, extractors): """Creates filters for the given col_params. Args: col_params: List of ListSessionGroupsRequest.ColParam protobufs. extractors: list of extractor functions of the same length as col_params. Each element should extract the column described by the correspond...
[ "def", "_create_filters", "(", "col_params", ",", "extractors", ")", ":", "result", "=", "[", "]", "for", "col_param", ",", "extractor", "in", "zip", "(", "col_params", ",", "extractors", ")", ":", "a_filter", "=", "_create_filter", "(", "col_param", ",", ...
Creates filters for the given col_params. Args: col_params: List of ListSessionGroupsRequest.ColParam protobufs. extractors: list of extractor functions of the same length as col_params. Each element should extract the column described by the corresponding element of col_params. Returns: A ...
[ "Creates", "filters", "for", "the", "given", "col_params", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/hparams/list_session_groups.py#L352-L369
train
Creates filters for the given col_params.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/hparams/list_session_groups.py
_create_filter
def _create_filter(col_param, extractor): """Creates a filter for the given col_param and extractor. Args: col_param: A tensorboard.hparams.ColParams object identifying the column and describing the filter to apply. extractor: A function that extract the column value identified by 'col_param' f...
python
def _create_filter(col_param, extractor): """Creates a filter for the given col_param and extractor. Args: col_param: A tensorboard.hparams.ColParams object identifying the column and describing the filter to apply. extractor: A function that extract the column value identified by 'col_param' f...
[ "def", "_create_filter", "(", "col_param", ",", "extractor", ")", ":", "include_missing_values", "=", "not", "col_param", ".", "exclude_missing_values", "if", "col_param", ".", "HasField", "(", "'filter_regexp'", ")", ":", "value_filter_fn", "=", "_create_regexp_filte...
Creates a filter for the given col_param and extractor. Args: col_param: A tensorboard.hparams.ColParams object identifying the column and describing the filter to apply. extractor: A function that extract the column value identified by 'col_param' from a tensorboard.hparams.SessionGroup protobuf...
[ "Creates", "a", "filter", "for", "the", "given", "col_param", "and", "extractor", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/hparams/list_session_groups.py#L372-L407
train
Creates a filter for the given col_param and extractor.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/hparams/list_session_groups.py
_create_regexp_filter
def _create_regexp_filter(regex): """Returns a boolean function that filters strings based on a regular exp. Args: regex: A string describing the regexp to use. Returns: A function taking a string and returns True if any of its substrings matches regex. """ # Warning: Note that python's regex lib...
python
def _create_regexp_filter(regex): """Returns a boolean function that filters strings based on a regular exp. Args: regex: A string describing the regexp to use. Returns: A function taking a string and returns True if any of its substrings matches regex. """ # Warning: Note that python's regex lib...
[ "def", "_create_regexp_filter", "(", "regex", ")", ":", "# Warning: Note that python's regex library allows inputs that take", "# exponential time. Time-limiting it is difficult. When we move to", "# a true multi-tenant tensorboard server, the regexp implementation here", "# would need to be repla...
Returns a boolean function that filters strings based on a regular exp. Args: regex: A string describing the regexp to use. Returns: A function taking a string and returns True if any of its substrings matches regex.
[ "Returns", "a", "boolean", "function", "that", "filters", "strings", "based", "on", "a", "regular", "exp", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/hparams/list_session_groups.py#L410-L431
train
Returns a function that filters strings based on a regular exp.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/hparams/list_session_groups.py
_create_interval_filter
def _create_interval_filter(interval): """Returns a function that checkes whether a number belongs to an interval. Args: interval: A tensorboard.hparams.Interval protobuf describing the interval. Returns: A function taking a number (a float or an object of a type in six.integer_types) that returns Tr...
python
def _create_interval_filter(interval): """Returns a function that checkes whether a number belongs to an interval. Args: interval: A tensorboard.hparams.Interval protobuf describing the interval. Returns: A function taking a number (a float or an object of a type in six.integer_types) that returns Tr...
[ "def", "_create_interval_filter", "(", "interval", ")", ":", "def", "filter_fn", "(", "value", ")", ":", "if", "(", "not", "isinstance", "(", "value", ",", "six", ".", "integer_types", ")", "and", "not", "isinstance", "(", "value", ",", "float", ")", ")"...
Returns a function that checkes whether a number belongs to an interval. Args: interval: A tensorboard.hparams.Interval protobuf describing the interval. Returns: A function taking a number (a float or an object of a type in six.integer_types) that returns True if the number belongs to (the closed) ...
[ "Returns", "a", "function", "that", "checkes", "whether", "a", "number", "belongs", "to", "an", "interval", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/hparams/list_session_groups.py#L434-L452
train
Creates a function that checks whether a number belongs to an interval.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/hparams/list_session_groups.py
_value_to_python
def _value_to_python(value): """Converts a google.protobuf.Value to a native Python object.""" assert isinstance(value, struct_pb2.Value) field = value.WhichOneof('kind') if field == 'number_value': return value.number_value elif field == 'string_value': return value.string_value elif field == 'boo...
python
def _value_to_python(value): """Converts a google.protobuf.Value to a native Python object.""" assert isinstance(value, struct_pb2.Value) field = value.WhichOneof('kind') if field == 'number_value': return value.number_value elif field == 'string_value': return value.string_value elif field == 'boo...
[ "def", "_value_to_python", "(", "value", ")", ":", "assert", "isinstance", "(", "value", ",", "struct_pb2", ".", "Value", ")", "field", "=", "value", ".", "WhichOneof", "(", "'kind'", ")", "if", "field", "==", "'number_value'", ":", "return", "value", ".",...
Converts a google.protobuf.Value to a native Python object.
[ "Converts", "a", "google", ".", "protobuf", ".", "Value", "to", "a", "native", "Python", "object", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/hparams/list_session_groups.py#L471-L483
train
Converts a google. protobuf. Value to a native Python object.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/hparams/list_session_groups.py
_set_avg_session_metrics
def _set_avg_session_metrics(session_group): """Sets the metrics for the group to be the average of its sessions. The resulting session group metrics consist of the union of metrics across the group's sessions. The value of each session group metric is the average of that metric values across the sessions in t...
python
def _set_avg_session_metrics(session_group): """Sets the metrics for the group to be the average of its sessions. The resulting session group metrics consist of the union of metrics across the group's sessions. The value of each session group metric is the average of that metric values across the sessions in t...
[ "def", "_set_avg_session_metrics", "(", "session_group", ")", ":", "assert", "session_group", ".", "sessions", ",", "'SessionGroup cannot be empty.'", "# Algorithm: Iterate over all (session, metric) pairs and maintain a", "# dict from _MetricIdentifier to _MetricStats objects.", "# Then...
Sets the metrics for the group to be the average of its sessions. The resulting session group metrics consist of the union of metrics across the group's sessions. The value of each session group metric is the average of that metric values across the sessions in the group. The 'step' and 'wall_time_secs' fields...
[ "Sets", "the", "metrics", "for", "the", "group", "to", "be", "the", "average", "of", "its", "sessions", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/hparams/list_session_groups.py#L524-L558
train
Sets the metrics for the group to be the average of its sessions.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/hparams/list_session_groups.py
_set_median_session_metrics
def _set_median_session_metrics(session_group, aggregation_metric): """Sets the metrics for session_group to those of its "median session". The median session is the session in session_group with the median value of the metric given by 'aggregation_metric'. The median is taken over the subset of sessions in th...
python
def _set_median_session_metrics(session_group, aggregation_metric): """Sets the metrics for session_group to those of its "median session". The median session is the session in session_group with the median value of the metric given by 'aggregation_metric'. The median is taken over the subset of sessions in th...
[ "def", "_set_median_session_metrics", "(", "session_group", ",", "aggregation_metric", ")", ":", "measurements", "=", "sorted", "(", "_measurements", "(", "session_group", ",", "aggregation_metric", ")", ",", "key", "=", "operator", ".", "attrgetter", "(", "'metric_...
Sets the metrics for session_group to those of its "median session". The median session is the session in session_group with the median value of the metric given by 'aggregation_metric'. The median is taken over the subset of sessions in the group whose 'aggregation_metric' was measured at the largest training...
[ "Sets", "the", "metrics", "for", "session_group", "to", "those", "of", "its", "median", "session", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/hparams/list_session_groups.py#L567-L584
train
Sets the metrics for the session_group to those of its median session.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/hparams/list_session_groups.py
_set_extremum_session_metrics
def _set_extremum_session_metrics(session_group, aggregation_metric, extremum_fn): """Sets the metrics for session_group to those of its "extremum session". The extremum session is the session in session_group with the extremum value of the metric given by 'aggregation_metric'. ...
python
def _set_extremum_session_metrics(session_group, aggregation_metric, extremum_fn): """Sets the metrics for session_group to those of its "extremum session". The extremum session is the session in session_group with the extremum value of the metric given by 'aggregation_metric'. ...
[ "def", "_set_extremum_session_metrics", "(", "session_group", ",", "aggregation_metric", ",", "extremum_fn", ")", ":", "measurements", "=", "_measurements", "(", "session_group", ",", "aggregation_metric", ")", "ext_session", "=", "extremum_fn", "(", "measurements", ","...
Sets the metrics for session_group to those of its "extremum session". The extremum session is the session in session_group with the extremum value of the metric given by 'aggregation_metric'. The extremum is taken over the subset of sessions in the group whose 'aggregation_metric' was measured at the largest ...
[ "Sets", "the", "metrics", "for", "session_group", "to", "those", "of", "its", "extremum", "session", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/hparams/list_session_groups.py#L587-L608
train
Sets the metrics for the extremum session in the given session_group to those of its extremum session.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/hparams/list_session_groups.py
_measurements
def _measurements(session_group, metric_name): """A generator for the values of the metric across the sessions in the group. Args: session_group: A SessionGroup protobuffer. metric_name: A MetricName protobuffer. Yields: The next metric value wrapped in a _Measurement instance. """ for session_in...
python
def _measurements(session_group, metric_name): """A generator for the values of the metric across the sessions in the group. Args: session_group: A SessionGroup protobuffer. metric_name: A MetricName protobuffer. Yields: The next metric value wrapped in a _Measurement instance. """ for session_in...
[ "def", "_measurements", "(", "session_group", ",", "metric_name", ")", ":", "for", "session_index", ",", "session", "in", "enumerate", "(", "session_group", ".", "sessions", ")", ":", "metric_value", "=", "_find_metric_value", "(", "session", ",", "metric_name", ...
A generator for the values of the metric across the sessions in the group. Args: session_group: A SessionGroup protobuffer. metric_name: A MetricName protobuffer. Yields: The next metric value wrapped in a _Measurement instance.
[ "A", "generator", "for", "the", "values", "of", "the", "metric", "across", "the", "sessions", "in", "the", "group", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/hparams/list_session_groups.py#L611-L624
train
A generator for the values of the metric across the sessions in the group.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/hparams/list_session_groups.py
Handler.run
def run(self): """Handles the request specified on construction. Returns: A ListSessionGroupsResponse object. """ session_groups = self._build_session_groups() session_groups = self._filter(session_groups) self._sort(session_groups) return self._create_response(session_groups)
python
def run(self): """Handles the request specified on construction. Returns: A ListSessionGroupsResponse object. """ session_groups = self._build_session_groups() session_groups = self._filter(session_groups) self._sort(session_groups) return self._create_response(session_groups)
[ "def", "run", "(", "self", ")", ":", "session_groups", "=", "self", ".", "_build_session_groups", "(", ")", "session_groups", "=", "self", ".", "_filter", "(", "session_groups", ")", "self", ".", "_sort", "(", "session_groups", ")", "return", "self", ".", ...
Handles the request specified on construction. Returns: A ListSessionGroupsResponse object.
[ "Handles", "the", "request", "specified", "on", "construction", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/hparams/list_session_groups.py#L53-L63
train
Handles the request specified on construction.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/hparams/list_session_groups.py
Handler._build_session_groups
def _build_session_groups(self): """Returns a list of SessionGroups protobuffers from the summary data.""" # Algorithm: We keep a dict 'groups_by_name' mapping a SessionGroup name # (str) to a SessionGroup protobuffer. We traverse the runs associated with # the plugin--each representing a single sessio...
python
def _build_session_groups(self): """Returns a list of SessionGroups protobuffers from the summary data.""" # Algorithm: We keep a dict 'groups_by_name' mapping a SessionGroup name # (str) to a SessionGroup protobuffer. We traverse the runs associated with # the plugin--each representing a single sessio...
[ "def", "_build_session_groups", "(", "self", ")", ":", "# Algorithm: We keep a dict 'groups_by_name' mapping a SessionGroup name", "# (str) to a SessionGroup protobuffer. We traverse the runs associated with", "# the plugin--each representing a single session. We form a Session", "# protobuffer fr...
Returns a list of SessionGroups protobuffers from the summary data.
[ "Returns", "a", "list", "of", "SessionGroups", "protobuffers", "from", "the", "summary", "data", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/hparams/list_session_groups.py#L65-L96
train
Builds a list of SessionGroups protobuffers from the summary data.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/hparams/list_session_groups.py
Handler._add_session
def _add_session(self, session, start_info, groups_by_name): """Adds a new Session protobuffer to the 'groups_by_name' dictionary. Called by _build_session_groups when we encounter a new session. Creates the Session protobuffer and adds it to the relevant group in the 'groups_by_name' dict. Creates the...
python
def _add_session(self, session, start_info, groups_by_name): """Adds a new Session protobuffer to the 'groups_by_name' dictionary. Called by _build_session_groups when we encounter a new session. Creates the Session protobuffer and adds it to the relevant group in the 'groups_by_name' dict. Creates the...
[ "def", "_add_session", "(", "self", ",", "session", ",", "start_info", ",", "groups_by_name", ")", ":", "# If the group_name is empty, this session's group contains only", "# this session. Use the session name for the group name since session", "# names are unique.", "group_name", "=...
Adds a new Session protobuffer to the 'groups_by_name' dictionary. Called by _build_session_groups when we encounter a new session. Creates the Session protobuffer and adds it to the relevant group in the 'groups_by_name' dict. Creates the session group if this is the first time we encounter it. A...
[ "Adds", "a", "new", "Session", "protobuffer", "to", "the", "groups_by_name", "dictionary", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/hparams/list_session_groups.py#L98-L130
train
Adds a new Session protobuffer to the groups_by_name dict.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/hparams/list_session_groups.py
Handler._build_session
def _build_session(self, name, start_info, end_info): """Builds a session object.""" assert start_info is not None result = api_pb2.Session( name=name, start_time_secs=start_info.start_time_secs, model_uri=start_info.model_uri, metric_values=self._build_session_metric_values...
python
def _build_session(self, name, start_info, end_info): """Builds a session object.""" assert start_info is not None result = api_pb2.Session( name=name, start_time_secs=start_info.start_time_secs, model_uri=start_info.model_uri, metric_values=self._build_session_metric_values...
[ "def", "_build_session", "(", "self", ",", "name", ",", "start_info", ",", "end_info", ")", ":", "assert", "start_info", "is", "not", "None", "result", "=", "api_pb2", ".", "Session", "(", "name", "=", "name", ",", "start_time_secs", "=", "start_info", "."...
Builds a session object.
[ "Builds", "a", "session", "object", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/hparams/list_session_groups.py#L132-L145
train
Builds a session object.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/hparams/list_session_groups.py
Handler._build_session_metric_values
def _build_session_metric_values(self, session_name): """Builds the session metric values.""" # result is a list of api_pb2.MetricValue instances. result = [] metric_infos = self._experiment.metric_infos for metric_info in metric_infos: metric_name = metric_info.name try: metric...
python
def _build_session_metric_values(self, session_name): """Builds the session metric values.""" # result is a list of api_pb2.MetricValue instances. result = [] metric_infos = self._experiment.metric_infos for metric_info in metric_infos: metric_name = metric_info.name try: metric...
[ "def", "_build_session_metric_values", "(", "self", ",", "session_name", ")", ":", "# result is a list of api_pb2.MetricValue instances.", "result", "=", "[", "]", "metric_infos", "=", "self", ".", "_experiment", ".", "metric_infos", "for", "metric_info", "in", "metric_...
Builds the session metric values.
[ "Builds", "the", "session", "metric", "values", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/hparams/list_session_groups.py#L147-L170
train
Builds the session metric values.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/hparams/list_session_groups.py
Handler._aggregate_metrics
def _aggregate_metrics(self, session_group): """Sets the metrics of the group based on aggregation_type.""" if (self._request.aggregation_type == api_pb2.AGGREGATION_AVG or self._request.aggregation_type == api_pb2.AGGREGATION_UNSET): _set_avg_session_metrics(session_group) elif self._request...
python
def _aggregate_metrics(self, session_group): """Sets the metrics of the group based on aggregation_type.""" if (self._request.aggregation_type == api_pb2.AGGREGATION_AVG or self._request.aggregation_type == api_pb2.AGGREGATION_UNSET): _set_avg_session_metrics(session_group) elif self._request...
[ "def", "_aggregate_metrics", "(", "self", ",", "session_group", ")", ":", "if", "(", "self", ".", "_request", ".", "aggregation_type", "==", "api_pb2", ".", "AGGREGATION_AVG", "or", "self", ".", "_request", ".", "aggregation_type", "==", "api_pb2", ".", "AGGRE...
Sets the metrics of the group based on aggregation_type.
[ "Sets", "the", "metrics", "of", "the", "group", "based", "on", "aggregation_type", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/hparams/list_session_groups.py#L172-L191
train
Sets the metrics of the group based on aggregation_type.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tensorflow/tensorboard
tensorboard/plugins/hparams/list_session_groups.py
Handler._sort
def _sort(self, session_groups): """Sorts 'session_groups' in place according to _request.col_params.""" # Sort by session_group name so we have a deterministic order. session_groups.sort(key=operator.attrgetter('name')) # Sort by lexicographical order of the _request.col_params whose order # is no...
python
def _sort(self, session_groups): """Sorts 'session_groups' in place according to _request.col_params.""" # Sort by session_group name so we have a deterministic order. session_groups.sort(key=operator.attrgetter('name')) # Sort by lexicographical order of the _request.col_params whose order # is no...
[ "def", "_sort", "(", "self", ",", "session_groups", ")", ":", "# Sort by session_group name so we have a deterministic order.", "session_groups", ".", "sort", "(", "key", "=", "operator", ".", "attrgetter", "(", "'name'", ")", ")", "# Sort by lexicographical order of the ...
Sorts 'session_groups' in place according to _request.col_params.
[ "Sorts", "session_groups", "in", "place", "according", "to", "_request", ".", "col_params", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/hparams/list_session_groups.py#L199-L226
train
Sorts the session_groups in place according to _request. col_params.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tyiannak/pyAudioAnalysis
pyAudioAnalysis/audioBasicIO.py
convertDirMP3ToWav
def convertDirMP3ToWav(dirName, Fs, nC, useMp3TagsAsName = False): ''' This function converts the MP3 files stored in a folder to WAV. If required, the output names of the WAV files are based on MP3 tags, otherwise the same names are used. ARGUMENTS: - dirName: the path of the folder where the MP3s...
python
def convertDirMP3ToWav(dirName, Fs, nC, useMp3TagsAsName = False): ''' This function converts the MP3 files stored in a folder to WAV. If required, the output names of the WAV files are based on MP3 tags, otherwise the same names are used. ARGUMENTS: - dirName: the path of the folder where the MP3s...
[ "def", "convertDirMP3ToWav", "(", "dirName", ",", "Fs", ",", "nC", ",", "useMp3TagsAsName", "=", "False", ")", ":", "types", "=", "(", "dirName", "+", "os", ".", "sep", "+", "'*.mp3'", ",", ")", "# the tuple of file types", "filesToProcess", "=", "[", "]",...
This function converts the MP3 files stored in a folder to WAV. If required, the output names of the WAV files are based on MP3 tags, otherwise the same names are used. ARGUMENTS: - dirName: the path of the folder where the MP3s are stored - Fs: the sampling rate of the generated WAV files ...
[ "This", "function", "converts", "the", "MP3", "files", "stored", "in", "a", "folder", "to", "WAV", ".", "If", "required", "the", "output", "names", "of", "the", "WAV", "files", "are", "based", "on", "MP3", "tags", "otherwise", "the", "same", "names", "ar...
e3da991e7247492deba50648a4c7c0f41e684af4
https://github.com/tyiannak/pyAudioAnalysis/blob/e3da991e7247492deba50648a4c7c0f41e684af4/pyAudioAnalysis/audioBasicIO.py#L5-L38
train
This function converts the MP3 files stored in a folder to WAV files.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tyiannak/pyAudioAnalysis
pyAudioAnalysis/audioBasicIO.py
convertFsDirWavToWav
def convertFsDirWavToWav(dirName, Fs, nC): ''' This function converts the WAV files stored in a folder to WAV using a different sampling freq and number of channels. ARGUMENTS: - dirName: the path of the folder where the WAVs are stored - Fs: the sampling rate of the generated WAV fil...
python
def convertFsDirWavToWav(dirName, Fs, nC): ''' This function converts the WAV files stored in a folder to WAV using a different sampling freq and number of channels. ARGUMENTS: - dirName: the path of the folder where the WAVs are stored - Fs: the sampling rate of the generated WAV fil...
[ "def", "convertFsDirWavToWav", "(", "dirName", ",", "Fs", ",", "nC", ")", ":", "types", "=", "(", "dirName", "+", "os", ".", "sep", "+", "'*.wav'", ",", ")", "# the tuple of file types", "filesToProcess", "=", "[", "]", "for", "files", "in", "types", ":"...
This function converts the WAV files stored in a folder to WAV using a different sampling freq and number of channels. ARGUMENTS: - dirName: the path of the folder where the WAVs are stored - Fs: the sampling rate of the generated WAV files - nC: the number of channesl of the ge...
[ "This", "function", "converts", "the", "WAV", "files", "stored", "in", "a", "folder", "to", "WAV", "using", "a", "different", "sampling", "freq", "and", "number", "of", "channels", ".", "ARGUMENTS", ":", "-", "dirName", ":", "the", "path", "of", "the", "...
e3da991e7247492deba50648a4c7c0f41e684af4
https://github.com/tyiannak/pyAudioAnalysis/blob/e3da991e7247492deba50648a4c7c0f41e684af4/pyAudioAnalysis/audioBasicIO.py#L40-L64
train
This function converts the WAV files stored in a folder to WAV using the different sampling rate and number of channels.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tyiannak/pyAudioAnalysis
pyAudioAnalysis/audioBasicIO.py
readAudioFile
def readAudioFile(path): ''' This function returns a numpy array that stores the audio samples of a specified WAV of AIFF file ''' extension = os.path.splitext(path)[1] try: #if extension.lower() == '.wav': #[Fs, x] = wavfile.read(path) if extension.lower() == '.aif' or ...
python
def readAudioFile(path): ''' This function returns a numpy array that stores the audio samples of a specified WAV of AIFF file ''' extension = os.path.splitext(path)[1] try: #if extension.lower() == '.wav': #[Fs, x] = wavfile.read(path) if extension.lower() == '.aif' or ...
[ "def", "readAudioFile", "(", "path", ")", ":", "extension", "=", "os", ".", "path", ".", "splitext", "(", "path", ")", "[", "1", "]", "try", ":", "#if extension.lower() == '.wav':", "#[Fs, x] = wavfile.read(path)", "if", "extension", ".", "lower", "(", ")", ...
This function returns a numpy array that stores the audio samples of a specified WAV of AIFF file
[ "This", "function", "returns", "a", "numpy", "array", "that", "stores", "the", "audio", "samples", "of", "a", "specified", "WAV", "of", "AIFF", "file" ]
e3da991e7247492deba50648a4c7c0f41e684af4
https://github.com/tyiannak/pyAudioAnalysis/blob/e3da991e7247492deba50648a4c7c0f41e684af4/pyAudioAnalysis/audioBasicIO.py#L66-L112
train
This function returns a numpy array that stores the audio samples of a specified WAV of AIFF file and returns the audio samples of the AIFF file.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tyiannak/pyAudioAnalysis
pyAudioAnalysis/audioBasicIO.py
stereo2mono
def stereo2mono(x): ''' This function converts the input signal (stored in a numpy array) to MONO (if it is STEREO) ''' if isinstance(x, int): return -1 if x.ndim==1: return x elif x.ndim==2: if x.shape[1]==1: return x.flatten() else: i...
python
def stereo2mono(x): ''' This function converts the input signal (stored in a numpy array) to MONO (if it is STEREO) ''' if isinstance(x, int): return -1 if x.ndim==1: return x elif x.ndim==2: if x.shape[1]==1: return x.flatten() else: i...
[ "def", "stereo2mono", "(", "x", ")", ":", "if", "isinstance", "(", "x", ",", "int", ")", ":", "return", "-", "1", "if", "x", ".", "ndim", "==", "1", ":", "return", "x", "elif", "x", ".", "ndim", "==", "2", ":", "if", "x", ".", "shape", "[", ...
This function converts the input signal (stored in a numpy array) to MONO (if it is STEREO)
[ "This", "function", "converts", "the", "input", "signal", "(", "stored", "in", "a", "numpy", "array", ")", "to", "MONO", "(", "if", "it", "is", "STEREO", ")" ]
e3da991e7247492deba50648a4c7c0f41e684af4
https://github.com/tyiannak/pyAudioAnalysis/blob/e3da991e7247492deba50648a4c7c0f41e684af4/pyAudioAnalysis/audioBasicIO.py#L114-L130
train
This function converts the input signal to MONO
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tyiannak/pyAudioAnalysis
pyAudioAnalysis/audioSegmentation.py
selfSimilarityMatrix
def selfSimilarityMatrix(featureVectors): ''' This function computes the self-similarity matrix for a sequence of feature vectors. ARGUMENTS: - featureVectors: a numpy matrix (nDims x nVectors) whose i-th column corresponds to the i-th feature vector RETURNS: ...
python
def selfSimilarityMatrix(featureVectors): ''' This function computes the self-similarity matrix for a sequence of feature vectors. ARGUMENTS: - featureVectors: a numpy matrix (nDims x nVectors) whose i-th column corresponds to the i-th feature vector RETURNS: ...
[ "def", "selfSimilarityMatrix", "(", "featureVectors", ")", ":", "[", "nDims", ",", "nVectors", "]", "=", "featureVectors", ".", "shape", "[", "featureVectors2", ",", "MEAN", ",", "STD", "]", "=", "aT", ".", "normalizeFeatures", "(", "[", "featureVectors", "....
This function computes the self-similarity matrix for a sequence of feature vectors. ARGUMENTS: - featureVectors: a numpy matrix (nDims x nVectors) whose i-th column corresponds to the i-th feature vector RETURNS: - S: the self-similarity matrix (nV...
[ "This", "function", "computes", "the", "self", "-", "similarity", "matrix", "for", "a", "sequence", "of", "feature", "vectors", ".", "ARGUMENTS", ":", "-", "featureVectors", ":", "a", "numpy", "matrix", "(", "nDims", "x", "nVectors", ")", "whose", "i", "-"...
e3da991e7247492deba50648a4c7c0f41e684af4
https://github.com/tyiannak/pyAudioAnalysis/blob/e3da991e7247492deba50648a4c7c0f41e684af4/pyAudioAnalysis/audioSegmentation.py#L38-L54
train
This function computes the self - similarity matrix for a sequence of feature vectors.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tyiannak/pyAudioAnalysis
pyAudioAnalysis/audioSegmentation.py
flags2segs
def flags2segs(flags, window): ''' ARGUMENTS: - flags: a sequence of class flags (per time window) - window: window duration (in seconds) RETURNS: - segs: a sequence of segment's limits: segs[i,0] is start and segs[i,1] are start and end point of segment i ...
python
def flags2segs(flags, window): ''' ARGUMENTS: - flags: a sequence of class flags (per time window) - window: window duration (in seconds) RETURNS: - segs: a sequence of segment's limits: segs[i,0] is start and segs[i,1] are start and end point of segment i ...
[ "def", "flags2segs", "(", "flags", ",", "window", ")", ":", "preFlag", "=", "0", "cur_flag", "=", "0", "n_segs", "=", "0", "cur_val", "=", "flags", "[", "cur_flag", "]", "segsList", "=", "[", "]", "classes", "=", "[", "]", "while", "(", "cur_flag", ...
ARGUMENTS: - flags: a sequence of class flags (per time window) - window: window duration (in seconds) RETURNS: - segs: a sequence of segment's limits: segs[i,0] is start and segs[i,1] are start and end point of segment i - classes: a sequence of class flags...
[ "ARGUMENTS", ":", "-", "flags", ":", "a", "sequence", "of", "class", "flags", "(", "per", "time", "window", ")", "-", "window", ":", "window", "duration", "(", "in", "seconds", ")" ]
e3da991e7247492deba50648a4c7c0f41e684af4
https://github.com/tyiannak/pyAudioAnalysis/blob/e3da991e7247492deba50648a4c7c0f41e684af4/pyAudioAnalysis/audioSegmentation.py#L57-L97
train
converts a sequence of class flags per time window into a sequence of class segs and classes
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tyiannak/pyAudioAnalysis
pyAudioAnalysis/audioSegmentation.py
segs2flags
def segs2flags(seg_start, seg_end, seg_label, win_size): ''' This function converts segment endpoints and respective segment labels to fix-sized class labels. ARGUMENTS: - seg_start: segment start points (in seconds) - seg_end: segment endpoints (in seconds) - seg_label: segment ...
python
def segs2flags(seg_start, seg_end, seg_label, win_size): ''' This function converts segment endpoints and respective segment labels to fix-sized class labels. ARGUMENTS: - seg_start: segment start points (in seconds) - seg_end: segment endpoints (in seconds) - seg_label: segment ...
[ "def", "segs2flags", "(", "seg_start", ",", "seg_end", ",", "seg_label", ",", "win_size", ")", ":", "flags", "=", "[", "]", "class_names", "=", "list", "(", "set", "(", "seg_label", ")", ")", "curPos", "=", "win_size", "/", "2.0", "while", "curPos", "<...
This function converts segment endpoints and respective segment labels to fix-sized class labels. ARGUMENTS: - seg_start: segment start points (in seconds) - seg_end: segment endpoints (in seconds) - seg_label: segment labels - win_size: fix-sized window (in seconds) RETURNS...
[ "This", "function", "converts", "segment", "endpoints", "and", "respective", "segment", "labels", "to", "fix", "-", "sized", "class", "labels", ".", "ARGUMENTS", ":", "-", "seg_start", ":", "segment", "start", "points", "(", "in", "seconds", ")", "-", "seg_e...
e3da991e7247492deba50648a4c7c0f41e684af4
https://github.com/tyiannak/pyAudioAnalysis/blob/e3da991e7247492deba50648a4c7c0f41e684af4/pyAudioAnalysis/audioSegmentation.py#L100-L122
train
This function converts segment endpoints and respective segment labels to fix - sized class indices.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tyiannak/pyAudioAnalysis
pyAudioAnalysis/audioSegmentation.py
computePreRec
def computePreRec(cm, class_names): ''' This function computes the precision, recall and f1 measures, given a confusion matrix ''' n_classes = cm.shape[0] if len(class_names) != n_classes: print("Error in computePreRec! Confusion matrix and class_names " "list must be of th...
python
def computePreRec(cm, class_names): ''' This function computes the precision, recall and f1 measures, given a confusion matrix ''' n_classes = cm.shape[0] if len(class_names) != n_classes: print("Error in computePreRec! Confusion matrix and class_names " "list must be of th...
[ "def", "computePreRec", "(", "cm", ",", "class_names", ")", ":", "n_classes", "=", "cm", ".", "shape", "[", "0", "]", "if", "len", "(", "class_names", ")", "!=", "n_classes", ":", "print", "(", "\"Error in computePreRec! Confusion matrix and class_names \"", "\"...
This function computes the precision, recall and f1 measures, given a confusion matrix
[ "This", "function", "computes", "the", "precision", "recall", "and", "f1", "measures", "given", "a", "confusion", "matrix" ]
e3da991e7247492deba50648a4c7c0f41e684af4
https://github.com/tyiannak/pyAudioAnalysis/blob/e3da991e7247492deba50648a4c7c0f41e684af4/pyAudioAnalysis/audioSegmentation.py#L124-L141
train
This function computes the precision recall and f1 measures given a confusion matrix and class_names list
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tyiannak/pyAudioAnalysis
pyAudioAnalysis/audioSegmentation.py
readSegmentGT
def readSegmentGT(gt_file): ''' This function reads a segmentation ground truth file, following a simple CSV format with the following columns: <segment start>,<segment end>,<class label> ARGUMENTS: - gt_file: the path of the CSV segment file RETURNS: - seg_start: a numpy array ...
python
def readSegmentGT(gt_file): ''' This function reads a segmentation ground truth file, following a simple CSV format with the following columns: <segment start>,<segment end>,<class label> ARGUMENTS: - gt_file: the path of the CSV segment file RETURNS: - seg_start: a numpy array ...
[ "def", "readSegmentGT", "(", "gt_file", ")", ":", "f", "=", "open", "(", "gt_file", ",", "'rt'", ")", "reader", "=", "csv", ".", "reader", "(", "f", ",", "delimiter", "=", "','", ")", "seg_start", "=", "[", "]", "seg_end", "=", "[", "]", "seg_label...
This function reads a segmentation ground truth file, following a simple CSV format with the following columns: <segment start>,<segment end>,<class label> ARGUMENTS: - gt_file: the path of the CSV segment file RETURNS: - seg_start: a numpy array of segments' start positions - seg_...
[ "This", "function", "reads", "a", "segmentation", "ground", "truth", "file", "following", "a", "simple", "CSV", "format", "with", "the", "following", "columns", ":", "<segment", "start", ">", "<segment", "end", ">", "<class", "label", ">" ]
e3da991e7247492deba50648a4c7c0f41e684af4
https://github.com/tyiannak/pyAudioAnalysis/blob/e3da991e7247492deba50648a4c7c0f41e684af4/pyAudioAnalysis/audioSegmentation.py#L144-L170
train
This function reads a segmentation ground truth file and returns a numpy array of segments.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tyiannak/pyAudioAnalysis
pyAudioAnalysis/audioSegmentation.py
plotSegmentationResults
def plotSegmentationResults(flags_ind, flags_ind_gt, class_names, mt_step, ONLY_EVALUATE=False): ''' This function plots statistics on the classification-segmentation results produced either by the fix-sized supervised method or the HMM method. It also computes the overall accuracy achieved by the respectiv...
python
def plotSegmentationResults(flags_ind, flags_ind_gt, class_names, mt_step, ONLY_EVALUATE=False): ''' This function plots statistics on the classification-segmentation results produced either by the fix-sized supervised method or the HMM method. It also computes the overall accuracy achieved by the respectiv...
[ "def", "plotSegmentationResults", "(", "flags_ind", ",", "flags_ind_gt", ",", "class_names", ",", "mt_step", ",", "ONLY_EVALUATE", "=", "False", ")", ":", "flags", "=", "[", "class_names", "[", "int", "(", "f", ")", "]", "for", "f", "in", "flags_ind", "]",...
This function plots statistics on the classification-segmentation results produced either by the fix-sized supervised method or the HMM method. It also computes the overall accuracy achieved by the respective method if ground-truth is available.
[ "This", "function", "plots", "statistics", "on", "the", "classification", "-", "segmentation", "results", "produced", "either", "by", "the", "fix", "-", "sized", "supervised", "method", "or", "the", "HMM", "method", ".", "It", "also", "computes", "the", "overa...
e3da991e7247492deba50648a4c7c0f41e684af4
https://github.com/tyiannak/pyAudioAnalysis/blob/e3da991e7247492deba50648a4c7c0f41e684af4/pyAudioAnalysis/audioSegmentation.py#L173-L240
train
This function plots statistics on the classification - segmentation results produced by the fix - solved supervised method or the HMM method.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tyiannak/pyAudioAnalysis
pyAudioAnalysis/audioSegmentation.py
trainHMM_computeStatistics
def trainHMM_computeStatistics(features, labels): ''' This function computes the statistics used to train an HMM joint segmentation-classification model using a sequence of sequential features and respective labels ARGUMENTS: - features: a numpy matrix of feature vectors (numOfDimensions x n_wi...
python
def trainHMM_computeStatistics(features, labels): ''' This function computes the statistics used to train an HMM joint segmentation-classification model using a sequence of sequential features and respective labels ARGUMENTS: - features: a numpy matrix of feature vectors (numOfDimensions x n_wi...
[ "def", "trainHMM_computeStatistics", "(", "features", ",", "labels", ")", ":", "u_labels", "=", "numpy", ".", "unique", "(", "labels", ")", "n_comps", "=", "len", "(", "u_labels", ")", "n_feats", "=", "features", ".", "shape", "[", "0", "]", "if", "featu...
This function computes the statistics used to train an HMM joint segmentation-classification model using a sequence of sequential features and respective labels ARGUMENTS: - features: a numpy matrix of feature vectors (numOfDimensions x n_wins) - labels: a numpy array of class indices (n_wins x...
[ "This", "function", "computes", "the", "statistics", "used", "to", "train", "an", "HMM", "joint", "segmentation", "-", "classification", "model", "using", "a", "sequence", "of", "sequential", "features", "and", "respective", "labels" ]
e3da991e7247492deba50648a4c7c0f41e684af4
https://github.com/tyiannak/pyAudioAnalysis/blob/e3da991e7247492deba50648a4c7c0f41e684af4/pyAudioAnalysis/audioSegmentation.py#L278-L330
train
This function computes the statistics used to train an HMM joint segmentation - classification model using a sequence of sequential features and their corresponding labels.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tyiannak/pyAudioAnalysis
pyAudioAnalysis/audioSegmentation.py
trainHMM_fromFile
def trainHMM_fromFile(wav_file, gt_file, hmm_model_name, mt_win, mt_step): ''' This function trains a HMM model for segmentation-classification using a single annotated audio file ARGUMENTS: - wav_file: the path of the audio filename - gt_file: the path of the ground truth filename ...
python
def trainHMM_fromFile(wav_file, gt_file, hmm_model_name, mt_win, mt_step): ''' This function trains a HMM model for segmentation-classification using a single annotated audio file ARGUMENTS: - wav_file: the path of the audio filename - gt_file: the path of the ground truth filename ...
[ "def", "trainHMM_fromFile", "(", "wav_file", ",", "gt_file", ",", "hmm_model_name", ",", "mt_win", ",", "mt_step", ")", ":", "[", "seg_start", ",", "seg_end", ",", "seg_labs", "]", "=", "readSegmentGT", "(", "gt_file", ")", "flags", ",", "class_names", "=", ...
This function trains a HMM model for segmentation-classification using a single annotated audio file ARGUMENTS: - wav_file: the path of the audio filename - gt_file: the path of the ground truth filename (a csv file of the form <segment start in seconds>,<segment end ...
[ "This", "function", "trains", "a", "HMM", "model", "for", "segmentation", "-", "classification", "using", "a", "single", "annotated", "audio", "file", "ARGUMENTS", ":", "-", "wav_file", ":", "the", "path", "of", "the", "audio", "filename", "-", "gt_file", ":...
e3da991e7247492deba50648a4c7c0f41e684af4
https://github.com/tyiannak/pyAudioAnalysis/blob/e3da991e7247492deba50648a4c7c0f41e684af4/pyAudioAnalysis/audioSegmentation.py#L333-L370
train
This function trains a HMM model for segmentation - classification using a single annotated audio file.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tyiannak/pyAudioAnalysis
pyAudioAnalysis/audioSegmentation.py
trainHMM_fromDir
def trainHMM_fromDir(dirPath, hmm_model_name, mt_win, mt_step): ''' This function trains a HMM model for segmentation-classification using a where WAV files and .segment (ground-truth files) are stored ARGUMENTS: - dirPath: the path of the data diretory - hmm_model_name: the name of ...
python
def trainHMM_fromDir(dirPath, hmm_model_name, mt_win, mt_step): ''' This function trains a HMM model for segmentation-classification using a where WAV files and .segment (ground-truth files) are stored ARGUMENTS: - dirPath: the path of the data diretory - hmm_model_name: the name of ...
[ "def", "trainHMM_fromDir", "(", "dirPath", ",", "hmm_model_name", ",", "mt_win", ",", "mt_step", ")", ":", "flags_all", "=", "numpy", ".", "array", "(", "[", "]", ")", "classes_all", "=", "[", "]", "for", "i", ",", "f", "in", "enumerate", "(", "glob", ...
This function trains a HMM model for segmentation-classification using a where WAV files and .segment (ground-truth files) are stored ARGUMENTS: - dirPath: the path of the data diretory - hmm_model_name: the name of the HMM model to be stored - mt_win: mid-term window size -...
[ "This", "function", "trains", "a", "HMM", "model", "for", "segmentation", "-", "classification", "using", "a", "where", "WAV", "files", "and", ".", "segment", "(", "ground", "-", "truth", "files", ")", "are", "stored", "ARGUMENTS", ":", "-", "dirPath", ":"...
e3da991e7247492deba50648a4c7c0f41e684af4
https://github.com/tyiannak/pyAudioAnalysis/blob/e3da991e7247492deba50648a4c7c0f41e684af4/pyAudioAnalysis/audioSegmentation.py#L373-L439
train
This function trains a HMM model from a directory containing WAV files and ground - truth files.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tyiannak/pyAudioAnalysis
pyAudioAnalysis/audioSegmentation.py
mtFileClassification
def mtFileClassification(input_file, model_name, model_type, plot_results=False, gt_file=""): ''' This function performs mid-term classification of an audio stream. Towards this end, supervised knowledge is used, i.e. a pre-trained classifier. ARGUMENTS: - input_file: ...
python
def mtFileClassification(input_file, model_name, model_type, plot_results=False, gt_file=""): ''' This function performs mid-term classification of an audio stream. Towards this end, supervised knowledge is used, i.e. a pre-trained classifier. ARGUMENTS: - input_file: ...
[ "def", "mtFileClassification", "(", "input_file", ",", "model_name", ",", "model_type", ",", "plot_results", "=", "False", ",", "gt_file", "=", "\"\"", ")", ":", "if", "not", "os", ".", "path", ".", "isfile", "(", "model_name", ")", ":", "print", "(", "\...
This function performs mid-term classification of an audio stream. Towards this end, supervised knowledge is used, i.e. a pre-trained classifier. ARGUMENTS: - input_file: path of the input WAV file - model_name: name of the classification model - model_type: svm or k...
[ "This", "function", "performs", "mid", "-", "term", "classification", "of", "an", "audio", "stream", ".", "Towards", "this", "end", "supervised", "knowledge", "is", "used", "i", ".", "e", ".", "a", "pre", "-", "trained", "classifier", ".", "ARGUMENTS", ":"...
e3da991e7247492deba50648a4c7c0f41e684af4
https://github.com/tyiannak/pyAudioAnalysis/blob/e3da991e7247492deba50648a4c7c0f41e684af4/pyAudioAnalysis/audioSegmentation.py#L491-L579
train
This function performs the MIDI classification of an audio file.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tyiannak/pyAudioAnalysis
pyAudioAnalysis/audioSegmentation.py
silenceRemoval
def silenceRemoval(x, fs, st_win, st_step, smoothWindow=0.5, weight=0.5, plot=False): ''' Event Detection (silence removal) ARGUMENTS: - x: the input audio signal - fs: sampling freq - st_win, st_step: window size and step in seconds - smoo...
python
def silenceRemoval(x, fs, st_win, st_step, smoothWindow=0.5, weight=0.5, plot=False): ''' Event Detection (silence removal) ARGUMENTS: - x: the input audio signal - fs: sampling freq - st_win, st_step: window size and step in seconds - smoo...
[ "def", "silenceRemoval", "(", "x", ",", "fs", ",", "st_win", ",", "st_step", ",", "smoothWindow", "=", "0.5", ",", "weight", "=", "0.5", ",", "plot", "=", "False", ")", ":", "if", "weight", ">=", "1", ":", "weight", "=", "0.99", "if", "weight", "<=...
Event Detection (silence removal) ARGUMENTS: - x: the input audio signal - fs: sampling freq - st_win, st_step: window size and step in seconds - smoothWindow: (optinal) smooth window (in seconds) - weight: (optinal) weight f...
[ "Event", "Detection", "(", "silence", "removal", ")", "ARGUMENTS", ":", "-", "x", ":", "the", "input", "audio", "signal", "-", "fs", ":", "sampling", "freq", "-", "st_win", "st_step", ":", "window", "size", "and", "step", "in", "seconds", "-", "smoothWin...
e3da991e7247492deba50648a4c7c0f41e684af4
https://github.com/tyiannak/pyAudioAnalysis/blob/e3da991e7247492deba50648a4c7c0f41e684af4/pyAudioAnalysis/audioSegmentation.py#L625-L738
train
Function that is used to silence removal of a signal in a short - term sequence.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tyiannak/pyAudioAnalysis
pyAudioAnalysis/audioSegmentation.py
speakerDiarization
def speakerDiarization(filename, n_speakers, mt_size=2.0, mt_step=0.2, st_win=0.05, lda_dim=35, plot_res=False): ''' ARGUMENTS: - filename: the name of the WAV file to be analyzed - n_speakers the number of speakers (clusters) in the recording (<=0 for unknown) ...
python
def speakerDiarization(filename, n_speakers, mt_size=2.0, mt_step=0.2, st_win=0.05, lda_dim=35, plot_res=False): ''' ARGUMENTS: - filename: the name of the WAV file to be analyzed - n_speakers the number of speakers (clusters) in the recording (<=0 for unknown) ...
[ "def", "speakerDiarization", "(", "filename", ",", "n_speakers", ",", "mt_size", "=", "2.0", ",", "mt_step", "=", "0.2", ",", "st_win", "=", "0.05", ",", "lda_dim", "=", "35", ",", "plot_res", "=", "False", ")", ":", "[", "fs", ",", "x", "]", "=", ...
ARGUMENTS: - filename: the name of the WAV file to be analyzed - n_speakers the number of speakers (clusters) in the recording (<=0 for unknown) - mt_size (opt) mid-term window size - mt_step (opt) mid-term window step - st_win (opt) short-term window size ...
[ "ARGUMENTS", ":", "-", "filename", ":", "the", "name", "of", "the", "WAV", "file", "to", "be", "analyzed", "-", "n_speakers", "the", "number", "of", "speakers", "(", "clusters", ")", "in", "the", "recording", "(", "<", "=", "0", "for", "unknown", ")", ...
e3da991e7247492deba50648a4c7c0f41e684af4
https://github.com/tyiannak/pyAudioAnalysis/blob/e3da991e7247492deba50648a4c7c0f41e684af4/pyAudioAnalysis/audioSegmentation.py#L741-L988
train
This function will analyze a WAV file and produce a list of speakers for each cluster.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tyiannak/pyAudioAnalysis
pyAudioAnalysis/audioSegmentation.py
speakerDiarizationEvaluateScript
def speakerDiarizationEvaluateScript(folder_name, ldas): ''' This function prints the cluster purity and speaker purity for each WAV file stored in a provided directory (.SEGMENT files are needed as ground-truth) ARGUMENTS: - folder_name: the full path of the folder ...
python
def speakerDiarizationEvaluateScript(folder_name, ldas): ''' This function prints the cluster purity and speaker purity for each WAV file stored in a provided directory (.SEGMENT files are needed as ground-truth) ARGUMENTS: - folder_name: the full path of the folder ...
[ "def", "speakerDiarizationEvaluateScript", "(", "folder_name", ",", "ldas", ")", ":", "types", "=", "(", "'*.wav'", ",", ")", "wavFilesList", "=", "[", "]", "for", "files", "in", "types", ":", "wavFilesList", ".", "extend", "(", "glob", ".", "glob", "(", ...
This function prints the cluster purity and speaker purity for each WAV file stored in a provided directory (.SEGMENT files are needed as ground-truth) ARGUMENTS: - folder_name: the full path of the folder where the WAV and SEGMENT (ground-truth) fi...
[ "This", "function", "prints", "the", "cluster", "purity", "and", "speaker", "purity", "for", "each", "WAV", "file", "stored", "in", "a", "provided", "directory", "(", ".", "SEGMENT", "files", "are", "needed", "as", "ground", "-", "truth", ")", "ARGUMENTS", ...
e3da991e7247492deba50648a4c7c0f41e684af4
https://github.com/tyiannak/pyAudioAnalysis/blob/e3da991e7247492deba50648a4c7c0f41e684af4/pyAudioAnalysis/audioSegmentation.py#L990-L1021
train
This function evaluates the cluster purity and speaker purity for each WAV file stored in a folder.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tyiannak/pyAudioAnalysis
pyAudioAnalysis/audioSegmentation.py
musicThumbnailing
def musicThumbnailing(x, fs, short_term_size=1.0, short_term_step=0.5, thumb_size=10.0, limit_1 = 0, limit_2 = 1): ''' This function detects instances of the most representative part of a music recording, also called "music thumbnails". A technique similar to the one proposed in [...
python
def musicThumbnailing(x, fs, short_term_size=1.0, short_term_step=0.5, thumb_size=10.0, limit_1 = 0, limit_2 = 1): ''' This function detects instances of the most representative part of a music recording, also called "music thumbnails". A technique similar to the one proposed in [...
[ "def", "musicThumbnailing", "(", "x", ",", "fs", ",", "short_term_size", "=", "1.0", ",", "short_term_step", "=", "0.5", ",", "thumb_size", "=", "10.0", ",", "limit_1", "=", "0", ",", "limit_2", "=", "1", ")", ":", "x", "=", "audioBasicIO", ".", "stere...
This function detects instances of the most representative part of a music recording, also called "music thumbnails". A technique similar to the one proposed in [1], however a wider set of audio features is used instead of chroma features. In particular the following steps are followed: - Extract s...
[ "This", "function", "detects", "instances", "of", "the", "most", "representative", "part", "of", "a", "music", "recording", "also", "called", "music", "thumbnails", ".", "A", "technique", "similar", "to", "the", "one", "proposed", "in", "[", "1", "]", "howev...
e3da991e7247492deba50648a4c7c0f41e684af4
https://github.com/tyiannak/pyAudioAnalysis/blob/e3da991e7247492deba50648a4c7c0f41e684af4/pyAudioAnalysis/audioSegmentation.py#L1023-L1109
train
This function detects instances of the most representative part of music recording also called music thumbnails.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tyiannak/pyAudioAnalysis
pyAudioAnalysis/audioVisualization.py
generateColorMap
def generateColorMap(): ''' This function generates a 256 jet colormap of HTML-like hex string colors (e.g. FF88AA) ''' Map = cm.jet(np.arange(256)) stringColors = [] for i in range(Map.shape[0]): rgb = (int(255*Map[i][0]), int(255*Map[i][1]), int(255*Map[i][2])) if (sys.vers...
python
def generateColorMap(): ''' This function generates a 256 jet colormap of HTML-like hex string colors (e.g. FF88AA) ''' Map = cm.jet(np.arange(256)) stringColors = [] for i in range(Map.shape[0]): rgb = (int(255*Map[i][0]), int(255*Map[i][1]), int(255*Map[i][2])) if (sys.vers...
[ "def", "generateColorMap", "(", ")", ":", "Map", "=", "cm", ".", "jet", "(", "np", ".", "arange", "(", "256", ")", ")", "stringColors", "=", "[", "]", "for", "i", "in", "range", "(", "Map", ".", "shape", "[", "0", "]", ")", ":", "rgb", "=", "...
This function generates a 256 jet colormap of HTML-like hex string colors (e.g. FF88AA)
[ "This", "function", "generates", "a", "256", "jet", "colormap", "of", "HTML", "-", "like", "hex", "string", "colors", "(", "e", ".", "g", ".", "FF88AA", ")" ]
e3da991e7247492deba50648a4c7c0f41e684af4
https://github.com/tyiannak/pyAudioAnalysis/blob/e3da991e7247492deba50648a4c7c0f41e684af4/pyAudioAnalysis/audioVisualization.py#L14-L29
train
This function generates a 256 jet colormap of HTML - like hex string colors
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tyiannak/pyAudioAnalysis
pyAudioAnalysis/audioVisualization.py
levenshtein
def levenshtein(str1, s2): ''' Distance between two strings ''' N1 = len(str1) N2 = len(s2) stringRange = [range(N1 + 1)] * (N2 + 1) for i in range(N2 + 1): stringRange[i] = range(i,i + N1 + 1) for i in range(0,N2): for j in range(0,N1): if str1[j] == s2[i]: ...
python
def levenshtein(str1, s2): ''' Distance between two strings ''' N1 = len(str1) N2 = len(s2) stringRange = [range(N1 + 1)] * (N2 + 1) for i in range(N2 + 1): stringRange[i] = range(i,i + N1 + 1) for i in range(0,N2): for j in range(0,N1): if str1[j] == s2[i]: ...
[ "def", "levenshtein", "(", "str1", ",", "s2", ")", ":", "N1", "=", "len", "(", "str1", ")", "N2", "=", "len", "(", "s2", ")", "stringRange", "=", "[", "range", "(", "N1", "+", "1", ")", "]", "*", "(", "N2", "+", "1", ")", "for", "i", "in", ...
Distance between two strings
[ "Distance", "between", "two", "strings" ]
e3da991e7247492deba50648a4c7c0f41e684af4
https://github.com/tyiannak/pyAudioAnalysis/blob/e3da991e7247492deba50648a4c7c0f41e684af4/pyAudioAnalysis/audioVisualization.py#L32-L52
train
Returns the Levenshtein distance between two strings
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
tyiannak/pyAudioAnalysis
pyAudioAnalysis/audioVisualization.py
text_list_to_colors
def text_list_to_colors(names): ''' Generates a list of colors based on a list of names (strings). Similar strings correspond to similar colors. ''' # STEP A: compute strings distance between all combnations of strings Dnames = np.zeros( (len(names), len(names)) ) for i in range(len(names)): ...
python
def text_list_to_colors(names): ''' Generates a list of colors based on a list of names (strings). Similar strings correspond to similar colors. ''' # STEP A: compute strings distance between all combnations of strings Dnames = np.zeros( (len(names), len(names)) ) for i in range(len(names)): ...
[ "def", "text_list_to_colors", "(", "names", ")", ":", "# STEP A: compute strings distance between all combnations of strings", "Dnames", "=", "np", ".", "zeros", "(", "(", "len", "(", "names", ")", ",", "len", "(", "names", ")", ")", ")", "for", "i", "in", "ra...
Generates a list of colors based on a list of names (strings). Similar strings correspond to similar colors.
[ "Generates", "a", "list", "of", "colors", "based", "on", "a", "list", "of", "names", "(", "strings", ")", ".", "Similar", "strings", "correspond", "to", "similar", "colors", "." ]
e3da991e7247492deba50648a4c7c0f41e684af4
https://github.com/tyiannak/pyAudioAnalysis/blob/e3da991e7247492deba50648a4c7c0f41e684af4/pyAudioAnalysis/audioVisualization.py#L55-L74
train
Generates a list of colors based on a list of strings. Similar strings correspond to similar colors.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...