MCPcopy Create free account
hub / github.com/TorchSSL/TorchSSL / matplotlib_plot

Method matplotlib_plot

custom_writer.py:90–98  ·  view source on GitHub ↗

Plot stats using Matplotlib and save images.

(self, output_dir: Union[str, Path])

Source from the content-addressed store, hash-verified

88 self.matplotlib_plot(self.log_dir)
89
90 def matplotlib_plot(self, output_dir: Union[str, Path]):
91 """Plot stats using Matplotlib and save images."""
92 keys2 = set.union(*[set(self.get_keys2(k)) for k in self.get_keys()])
93 for key2 in keys2:
94 keys = [k for k in self.get_keys() if key2 in self.get_keys2(k)]
95 plt = self._plot_stats(keys, key2)
96 p = Path(output_dir) / f"{key2}.png"
97 p.parent.mkdir(parents=True, exist_ok=True)
98 plt.savefig(p)
99
100 def _plot_stats(self, keys: Sequence[str], key2: str):
101 # str is also Sequence[str]

Callers 1

plot_statsMethod · 0.95

Calls 3

get_keys2Method · 0.95
get_keysMethod · 0.95
_plot_statsMethod · 0.95

Tested by

no test coverage detected