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

Method parse

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

Override existing hyperparameter values, parsing new values from a string. See parse_values for more detail on the allowed format for values. Args: values: String. Comma separated list of `name=value` pairs where 'value' must follow the syntax described above. Returns:

(self, values)

Source from the content-addressed store, hash-verified

535 del self._hparam_types[name]
536
537 def parse(self, values):
538 """Override existing hyperparameter values, parsing new values from a string.
539
540 See parse_values for more detail on the allowed format for values.
541
542 Args:
543 values: String. Comma separated list of `name=value` pairs where 'value'
544 must follow the syntax described above.
545
546 Returns:
547 The `HParams` instance.
548
549 Raises:
550 ValueError: If `values` cannot be parsed or a hyperparameter in `values`
551 doesn't exist.
552 """
553 type_map = {}
554 for name, t in self._hparam_types.items():
555 param_type, _ = t
556 type_map[name] = param_type
557
558 values_map = parse_values(values, type_map)
559 return self.override_from_dict(values_map)
560
561 def override_from_dict(self, values_dict):
562 """Override existing hyperparameter values, parsing new values from a dictionary.

Callers 15

testEmptyMethod · 0.95
testSomeValuesMethod · 0.95
testBoolParsingMethod · 0.95
testBoolParsingFailMethod · 0.95
testListsMethod · 0.95
testStrMethod · 0.95
CreateMethod · 0.45
_generate_signatureFunction · 0.45
visit_ImportMethod · 0.45
update_string_pastaMethod · 0.45

Calls 2

override_from_dictMethod · 0.95
parse_valuesFunction · 0.85

Tested by 15

testEmptyMethod · 0.76
testSomeValuesMethod · 0.76
testBoolParsingMethod · 0.76
testBoolParsingFailMethod · 0.76
testListsMethod · 0.76
testStrMethod · 0.76
_prune_modelMethod · 0.36
setUpMethod · 0.36
_blockMaskingMethod · 0.36