MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / to_json

Method to_json

tensorflow/contrib/training/python/training/hparam.py:589–608  ·  view source on GitHub ↗

Serializes the hyperparameters into JSON. Args: indent: If a non-negative integer, JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0, or negative, will only insert newlines. `None` (the default) selects the m

(self, indent=None, separators=None, sort_keys=False)

Source from the content-addressed store, hash-verified

587 return self._model_structure
588
589 def to_json(self, indent=None, separators=None, sort_keys=False):
590 """Serializes the hyperparameters into JSON.
591
592 Args:
593 indent: If a non-negative integer, JSON array elements and object members
594 will be pretty-printed with that indent level. An indent level of 0, or
595 negative, will only insert newlines. `None` (the default) selects the
596 most compact representation.
597 separators: Optional `(item_separator, key_separator)` tuple. Default is
598 `(', ', ': ')`.
599 sort_keys: If `True`, the output dictionaries will be sorted by key.
600
601 Returns:
602 A JSON string.
603 """
604 return json.dumps(
605 self.values(),
606 indent=indent,
607 separators=separators,
608 sort_keys=sort_keys)
609
610 def parse_json(self, values_json):
611 """Override existing hyperparameter values, parsing new values from a json object.

Callers 2

testJsonMethod · 0.95
print_hparamsMethod · 0.45

Calls 1

valuesMethod · 0.95

Tested by 1

testJsonMethod · 0.76