Returns a yaml string containing the network configuration. To load a network from a yaml save file, use `keras.models.model_from_yaml(yaml_string, custom_objects={})`. `custom_objects` should be a dictionary mapping the names of custom losses / layers / etc to the corresponding
(self, **kwargs)
| 1407 | model_config, default=serialization.get_json_type, **kwargs) |
| 1408 | |
| 1409 | def to_yaml(self, **kwargs): |
| 1410 | """Returns a yaml string containing the network configuration. |
| 1411 | |
| 1412 | To load a network from a yaml save file, use |
| 1413 | `keras.models.model_from_yaml(yaml_string, custom_objects={})`. |
| 1414 | |
| 1415 | `custom_objects` should be a dictionary mapping |
| 1416 | the names of custom losses / layers / etc to the corresponding |
| 1417 | functions / classes. |
| 1418 | |
| 1419 | Arguments: |
| 1420 | **kwargs: Additional keyword arguments |
| 1421 | to be passed to `yaml.dump()`. |
| 1422 | |
| 1423 | Returns: |
| 1424 | A YAML string. |
| 1425 | |
| 1426 | Raises: |
| 1427 | ImportError: if yaml module is not found. |
| 1428 | """ |
| 1429 | if yaml is None: |
| 1430 | raise ImportError( |
| 1431 | 'Requires yaml module installed (`pip install pyyaml`).') |
| 1432 | return yaml.dump(self._updated_config(), **kwargs) |
| 1433 | |
| 1434 | def summary(self, line_length=None, positions=None, print_fn=None): |
| 1435 | """Prints a string summary of the network. |