log_parse
parse_log_dir
¶
A function which will gather all log files within a given folder and pass them along for visualization.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dir_path |
str
|
The path to a directory containing log files (or the path to a specific single log file). |
required |
log_extension |
str
|
The extension of the log files. |
'.txt'
|
recursive_search |
bool
|
Whether to recursively search sub-directories for log files. |
False
|
smooth_factor |
float
|
A non-negative float representing the magnitude of gaussian smoothing to apply (zero for none). |
0
|
save |
bool
|
Whether to save (True) or display (False) the generated graph. |
False
|
save_path |
Optional[str]
|
Where to save the image if save is true. Defaults to dir_path if not provided. |
None
|
ignore_metrics |
Optional[Set[str]]
|
Any metrics within the log files which will not be visualized. |
None
|
include_metrics |
Optional[Set[str]]
|
A whitelist of metric keys (None whitelists all keys). |
None
|
pretty_names |
bool
|
Whether to modify the metric names in graph titles (True) or leave them alone (False). |
False
|
group_by |
Optional[str]
|
Combine multiple log files by a regex to visualize their mean+-stddev. For example, to group together files like [a_1.txt, a_2.txt] vs [b_1.txt, b_2.txt] you can use: r'(.*)_[\d]+.txt'. |
None
|
Source code in fastestimator/fastestimator/summary/logs/log_parse.py
parse_log_file
¶
A function which will parse log files into a dictionary of metrics.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_path |
str
|
The path to a log file. |
required |
file_extension |
str
|
The extension of the log file. |
required |
Returns: An experiment summarizing the given log file.
Source code in fastestimator/fastestimator/summary/logs/log_parse.py
parse_log_files
¶
Parse one or more log files for graphing.
This function which will iterate through the given log file paths, parse them to extract metrics, remove any metrics which are blacklisted, and then pass the necessary information on the graphing function.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_paths |
List[str]
|
A list of paths to various log files. |
required |
log_extension |
Optional[str]
|
The extension of the log files. |
'.txt'
|
smooth_factor |
float
|
A non-negative float representing the magnitude of gaussian smoothing to apply (zero for none). |
0
|
save |
bool
|
Whether to save (True) or display (False) the generated graph. |
False
|
save_path |
Optional[str]
|
Where to save the image if save is true. Defaults to dir_path if not provided. |
None
|
ignore_metrics |
Optional[Set[str]]
|
Any metrics within the log files which will not be visualized. |
None
|
include_metrics |
Optional[Set[str]]
|
A whitelist of metric keys (None whitelists all keys). |
None
|
pretty_names |
bool
|
Whether to modify the metric names in graph titles (True) or leave them alone (False). |
False
|
group_by |
Optional[str]
|
Combine multiple log files by a regex to visualize their mean+-stddev. For example, to group together files like [a_1.txt, a_2.txt] vs [b_1.txt, b_2.txt] you can use: r'(.*)_[\d]+.txt'. |
None
|
Raises:
Type | Description |
---|---|
AssertionError
|
If no log files are provided. |
ValueError
|
If a log file does not match the |
Source code in fastestimator/fastestimator/summary/logs/log_parse.py
parse_log_iter
¶
A function which will parse lines into a dictionary of metrics.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
source |
Iterable[str]
|
A collection of lines to parse. |
required |
sync |
Summary
|
The summary to append into. |
required |
Returns:
Type | Description |
---|---|
Summary
|
The updated summary object. |