MCPcopy Create free account
hub / github.com/geekcomputers/Python / plot_learning_rate

Function plot_learning_rate

ML/src/python/neuralforge/utils/visualization.py:47–65  ·  view source on GitHub ↗
(
    lr_history: List[float],
    save_path: Optional[str] = None,
    figsize: tuple = (10, 5)
)

Source from the content-addressed store, hash-verified

45 plt.close()
46
47def plot_learning_rate(
48 lr_history: List[float],
49 save_path: Optional[str] = None,
50 figsize: tuple = (10, 5)
51):
52 plt.figure(figsize=figsize)
53 plt.plot(lr_history, linewidth=2)
54 plt.xlabel('Step')
55 plt.ylabel('Learning Rate')
56 plt.title('Learning Rate Schedule')
57 plt.grid(True, alpha=0.3)
58 plt.yscale('log')
59
60 if save_path:
61 os.makedirs(os.path.dirname(save_path), exist_ok=True)
62 plt.savefig(save_path, dpi=300, bbox_inches='tight')
63 print(f"Learning rate plot saved to {save_path}")
64
65 plt.close()
66
67def plot_confusion_matrix(
68 cm: np.ndarray,

Callers

nothing calls this directly

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected